resque-scheduler在删除作业时失败

时间:2014-08-03 21:38:05

标签: ruby redis resque resque-scheduler

我使用了Github中的POC(队列丢失了,我添加了它:

name = 'send_emails'
config = {}
config[:class] = 'SendEmail'
config[:args] = 'POC email subject'
config[:cron] = '* * * * * *'
config[:persist] = true
config[:queue] = 'new'
Resque.set_schedule(name, config)
sleep(10)
#Try to remove the job
Resque.remove_schedule(name)

我收到以下错误:

/var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:295:in `block in update_schedule': undefined method `keys' for nil:NilClass (NoMethodError)
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:292:in `loop'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:292:in `update_schedule'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:57:in `block in run'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:53:in `loop'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler.rb:53:in `run'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler/cli.rb:117:in `run_forever'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler/cli.rb:90:in `run!'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/lib/resque/scheduler/cli.rb:80:in `run!'
        from /var/lib/gems/1.9.1/gems/resque-scheduler-3.0.0/bin/resque-scheduler:5:in `<top (required)>'
        from /usr/local/bin/resque-scheduler:19:in `load'
        from /usr/local/bin/resque-scheduler:19:in `<main>'

1 个答案:

答案 0 :(得分:0)

这是救援计划程序中的一个错误。删除最后一个作业时,调度程序失败。该错误已在以后的版本中修复。您可以找到完整的详细信息here