开发者

How do you run a task biweekly from a particular date using rufus-scheduler

I'm trying to run a task every two weeks starting today, but in my tests, its seems that when rufus scheduler starts up, it tries to run the task however many times it has 'missed' until it catches up.

So for example, if I try something like this

require 'chronic'
scheduler = Rufus::Scheduler.start_new

scheduler.every '20m', :fi开发者_开发问答rst_at => Chronic.parse('February 7 2011 at 5pm') do
    User.send_emails if Rails.env.eql?('development')
end

if the time is 5:57 ... scheduler will try to send the emails twice to make up for the times it 'missed' at 5:20 and 5:40 ... make sense? Is there a way to get it to send as normal without trying to 'catch up'?


Answered at http://groups.google.com/group/rufus-ruby/browse_thread/thread/e0aa06d29ae4ef69

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜