mailerをSidekiqで非同期としています。
開発環境では非同期で送信されるのですが、heroku上では送信されません
heroku環境だとキューは入るのですがプロセスが入らないです。
開発環境手順
$ redis-server
$ bundle exec sidekiq -q default -q mailers
heroku
lang
1#Procfile 2clock: bundle exec clockwork lib/clock.rb 3redis: bundle exec redis-server /usr/local/etc/redis.conf 4worker: bundle exec sidekiq -C config/sidekiq.yml 5worker: bundle exec sidekiq -q default -q mailers
herokuでredisを使用する場合
lang
1ma-no-MacBook-Air:appname ma$ heroku addons:add rediscloud 2Setting config vars and restarting appname... done, v15 3REDIS_PROVIDER: REDISCLOUD_URL 4ma-no-MacBook-Air:appname ma$ heroku config:set REDIS_PROVIDER=REDISCLOUD_URL 506:57:56 clock.1 | started with pid 2019 606:57:56 redis.1 | started with pid 2020 706:57:56 worker.1 | started with pid 2021 806:57:56 worker.1 | started with pid 2022 906:57:56 redis.1 | [2020] 16 Jul 06:57:56.592 # Creating Server TCP listening socket 127.0.0.1:6379: bind: Address already in use 1006:57:56 redis.1 | exited with code 1 1106:57:56 system | sending SIGTERM to all processes 1206:57:56 worker.1 | terminated by SIGTERM 1306:57:56 clock.1 | terminated by SIGTERM 1406:57:56 worker.1 | exited with code 1 15ma-no-MacBook-Air:appname ma$ $ foreman start 1606:57:56 clock.1 | started with pid 2019 1706:57:56 redis.1 | started with pid 2020 1806:57:56 worker.1 | started with pid 2021 1906:57:56 worker.1 | started with pid 2022 2006:57:56 redis.1 | [2020] 16 Jul 06:57:56.592 # Creating Server TCP listening socket 127.0.0.1:6379: bind: Address already in use 2106:57:56 redis.1 | exited with code 1 2206:57:56 system | sending SIGTERM to all processes 2306:57:56 worker.1 | terminated by SIGTERM 2406:57:56 clock.1 | terminated by SIGTERM 2506:57:56 worker.1 | exited with code 1
lang
1#config/initializers/sidkiq.rb 2Sidekiq.configure_server do |config| 3 if Rails.env.production? 4 if ENV['REDISCLOUD_URL'] 5 config.redis = { url: ENV['REDISCLOUD_URL'], namespace: 'sidekiq' } 6 end 7 else 8 config.redis = { url: 'redis://localhost:6379', namespace: 'sidekiq' } 9 end 10end
下記を試したところ
Procfile
-worker: bundle exec sidekiq -C config/sidekiq.yml
+worker: mkdir -p tmp/pids && bundle exec sidekiq -C config/sidekiq.yml
ruby
1ma$ heroku config:set REDIS_PROVIDER=REDISCLOUD_URL 2Setting config vars and restarting appname... failed 3 ! Heroku client internal error. 4 ! Search for help at: https://help.heroku.com 5 ! Or report a bug at: https://github.com/heroku/heroku/issues/new 6 7 Error: read timeout reached (Excon::Errors::Timeout) 8 Command: heroku config:set REDIS_PROVIDER=REDISCLOUD_URL 9 Version: heroku-toolbelt/3.39.5 (x86_64-darwin10.8.0) ruby/1.9.3 10 Error ID: 5255bcc5affd49bc99941d043e703193 11 12 13 More information in /Users/ma/.heroku/error.log
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2015/07/16 03:58
2015/07/16 05:03
退会済みユーザー
2015/07/16 08:02