[Backgroundrb-devel] repeat_every doesn't tie in with first_run...
lapomme00 at gmail.com
Mon Aug 7 07:49:14 EDT 2006
Sorry for inundating the list. In using the autostart, repeat_every,
and first_run, I noticed a behaviour I didn't expect.
I would like the job to run starting at 2am, and then every 24 hours.
So I set first_run to Time.now.beginning_of_day + 2.hours, and
repeat_every to 24.hours.
The problem is if backgroundrb starts up at 6am (due to a code change
or server bump), then the process runs immediately (because first_run
< Time.now), and then runs every 24 hours from that time, so 6am every
day. I was expecting more cron-ish behaviour, where it would start at
the first_run time and repeat based on that initial time.
Is this the proper behaviour? Personally, I like the cron style
better - it gives me tighter control, which might be required for
better resource utilization. If I want it to start running
immediatley, I can put in first_run Time.now.
More information about the Backgroundrb-devel