开发者

Getting delayed_job to just work

I followed the railscast which uses CollectiveIdea's fork. I'm not able to get it to work. I created a new file in my /lib folder and included this

class Device
  def deliver
    #my long running method
  end
  handle_asynchronously :deliver
end

device = Device.new
device.deliver 

I do a script/delayed_job and that forks an app instance. Now,

  1. There's no job activity going on. Nothing in the delayed_jobs table and nothing in the logs. Am I missing something here?
  2. How do I set the 开发者_JAVA技巧interval for which the method should be run? (Ex every 30 seconds)

I'm testing this in the development mode (Rails 2.3.2), and soon will be moving this into production.

Thanks !


Do you see a process for the script/delayed_job that you ran? Do a ps aux | grep delayed_job and see if there is a process running.

AFAIK, you cannot set any time intervals using Delayed Job.


As a first step to diagnose the problem:

  1. Stop your job workers
  2. Launch a delayed job
  3. Check whether it is present in the database.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜