[Backgroundrb-devel] repeat_every doesn't tie in with first_run...
info at siebert-wd.de
Mon Aug 7 08:02:30 EDT 2006
That Behaviour is absolutely OK, since it starts the job when Time.now >
first_start. Time.now.beginning_of_day is 0:00 TODAY, meaning 14 hours ago
(at least here in Germany). The only way to work around that is to use
Time.now.tomorrow.beginning_of_day meaning 0:00 tonight. I think this can be
improved in some later version.
2006/8/7, Brett Walker <lapomme00 at gmail.com>:
> 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.
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
Michael Siebert <info at siebert-wd.de>
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Backgroundrb-devel