heroku延迟了工作停滞思想过程正在运行,rails

时间:2012-05-13 04:50:10

标签: ruby-on-rails heroku delayed-job

我试图让delayed_job在heroku中工作。 我一直在关注

https://devcenter.heroku.com/articles/delayed-jobhttps://devcenter.heroku.com/articles/procfile

我在我的root上创建了一个Procfile并传入

worker: rake jobs:work

当我做任何

时,我的delayed_job在我的开发机器上工作
rake jobs:work
foreman start

然而,在heroku上似乎找不到我的delayed_jobs。我跑的时候

heroku ps

它说

Process   State       Command
--------  ----------  ---------------------------------
run.1     up for 27m  bundle exec rails console
web.1     up for 28m  bundle exec rails server -p $PORT
worker.1  up for 28m  rake jobs:work

我做了命令

heroku ps:scale worker=1
早些时候(我不认为我必须再做一次......)

只是为了检查我的工作是否正在运行(他们应该这样做)

heroku console
irb(main):001:0> Delayed::Job.all

但这回到我身边

Delayed::Backend::ActiveRecord::Job Load (1.4ms)  SELECT "delayed_jobs".* FROM "delayed_jobs" => []

它似乎找不到delayed_job。

在我的代码中,我执行了类似

的操作
$index.document(@lesson.id).delay.update_variables({ 0 => new_score})

和delayed_job在我的开发中起作用。

我试图通过执行

来隔离问题
heroku run bundle exec rake jobs:work
然而,它所吐出的只是...

Running bundle exec rake jobs:work attached to terminal... up, run.2
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
[Worker(host:39da7fc7-7b64-49c1-8e8c-36242e705abf pid:7)] Starting job worker

为什么在我尝试运行它时会停止生产?

谢谢。

0 个答案:

没有答案