[Backgroundrb-devel] Fwd: [PATCH] making backgroundrb cron
Michael Siebert
info at siebert-wd.de
Tue Aug 1 12:02:28 EDT 2006
damn i forgot to cc the list... (thanks charles for telling me)
here it is
---------- Forwarded message ----------
From: Michael Siebert <info at siebert-wd.de>
Date: 01.08.2006 17:27
Subject: [PATCH] making backgroundrb cron
To: Charles Brian Quinn <me at seebq.com>
It wasnt a too hard thing to do. Heres the Patch for
vendor/plugins/backgroundrb/backgroundrb.rb
You declare a worker to be a repetitive one by doing this in your worker
class:
class FooWorker < BackgrounDRb::Rails
repeat 24.hours
start_first tomorrow.midnight
def do_work
@ logger.info 'i will appear on midnight every day from now!'
end
end
now the task is started next midnight and repeated every 24 hours.
start_first even takes "17:00" and stuff (everything Time#parse can
parse).you should even be able to control thestart time and interval via the
methods #next_start and #interval (they're attr_accessors)
for me its working perfectly, but a little bit of testing would sure be good
did i mention that i love bgdrb more and more every day i find a new thing
it can work out for me?
--
Michael Siebert < info at siebert-wd.de>
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
--
Michael Siebert <info at siebert-wd.de>
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/9b7948a1/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bgdrbcron.patch
Type: application/octet-stream
Size: 2100 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/9b7948a1/attachment.obj
More information about the Backgroundrb-devel
mailing list