我想加載一個簡單的ruby應用程序定期運行後臺任務使用resque,其中檢查電子郵件帳戶。它與當地工頭在當地很好地合作,但在heroku上不斷崩潰。
我想也許Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
來自我的while循環,這是永久的,因此超過60秒?我應該使用一些不同的過程來啓動smsnotify.rb嗎?
任何幫助將不勝感激!
我的Heroku的日誌:
2013-04-06T20:49:15+00:00 heroku[slugc]: Slug compilation finished
2013-04-06T20:49:18+00:00 heroku[web.1]: Starting process with command `bundle exec ruby smsnotify.rb -p 9129`
2013-04-06T20:49:21+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.0.0/lib/active_support/multibyte.rb:26: warning: already initialized constant VALID_CHARACTER
2013-04-06T20:50:19+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2013-04-06T20:50:19+00:00 heroku[web.1]: Stopping process with SIGKILL
2013-04-06T20:50:20+00:00 heroku[web.1]: Process exited with status 137
2013-04-06T20:50:20+00:00 heroku[web.1]: State changed from starting to crashed
我Procfile:
web: bundle exec ruby smsnotify.rb -p $PORT
resque: env TERM_CHILD=1 bundle exec rake jobs:work
smsnotify.rb:
require "./email_checker"
require 'hirefire'
require 'resque'
Resque.redis = 'redis://redistogo:removed:removed/'
HireFire::Initializer.initialize!
while true do
Resque.enqueue(EmailChecker)
sleep 30
puts "Starting Email Job"
end
我不認爲你可以在heroku中做到這一點。他們提供的用於後臺處理的替代方法是延遲作業(DJ)。這更好地解釋了整個過程:https://devcenter.heroku.com/articles/delayed-job,請記住,您將收取'工作人員'使用費。 – fmendez 2013-04-06 01:02:12
謝謝 - 我已經切換到使用resque並在後臺檢查電子郵件帳戶。再次,這工作正常本地,但我得到錯誤R10(啓動超時) - > Web過程無法綁定到$ PORT在發射錯誤60秒內啓動應用程序在heroku上時。也許錯誤來自我的while循環,這是永久的,因此超過60秒?我應該使用一些不同的過程來啓動smsnotify.rb嗎? – Nick5a1 2013-04-06 21:04:16
我更新了這個問題。 Heroku支持Resque。任何人都可以提供一些指導嗎? – Nick5a1 2013-04-07 19:00:22