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

519 views Asked by At

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', :first_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'?

1

There are 1 answers

0
jmettraux On BEST ANSWER