search for: repeat_every

Displaying 13 results from an estimated 13 matches for "repeat_every".

2006 Aug 29
1
Tasks get executed twice with repeat_every
I have a simple worker that I set up with repeat_every: class DueNoteQueuerWorker < BackgrounDRb::Rails repeat_every 1.minutes first_run Time.now def do_work(args) @logger.debug("Sending due notes. The current time is #{Time.now}") end end I want this to run every minute, all the time. The first run is fine, but it...
2006 Oct 27
0
double runs from repeat_every
...ing out with BackgrounDRB and I''m pretty excited. I know there''s some development going on, but would patches against the released code be welcome? Nothing profound, just some documentation errors. Now for the real reason I''m writing. I''m testing the new(ish) repeat_every code and it appears to be having a problem. I''ve got a very, very simple worker. The do_work method just logs the current time, job key and process ID. It''s started from an autostart configuration in backgroundrb.yml. Most of the time it seems to work just fine. If I say repe...
2006 Aug 25
1
repeat_every when a worker is not done yet...
If I use repeat_every for a worker, if the do_work function has not completed by the time the next interval rolls around, will a new thread be started, resulting in 2 threads for the same worker? Looking at start_process, it seems like the thread gets created (which spins off the thread and then continues to execute th...
2006 Aug 07
3
repeat_every doesn''t tie in with first_run...
Ezra, 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 s...
2006 Dec 13
4
Unintended thread forked in autostart
Hello all, I''ve got the problem about the following simple application using autostart and repeat_every. A thread(?) is forked for processing task at first, but at sencond time two threads seem to be forked. My simple application code is... - In worker class class FooWorker < BackgrounDRb:Rails repeat_every 2.minutes first_run Time.now def do_work puts Time.now.to_s + "Start...
2006 Jul 13
4
Update
Folks- I just commited another revision of the plugin. Nothing huge in this update but some extra features. Acl lists are now configurable in the config file. So you will want to blow away and recreate your config file again. Thanks to Georg Friedrich for this. And I applied Gunter Ladwig''s patch for singleton worker classes. These are workers that only have one instance of
2006 Sep 25
1
Clearing ActiveRecord Sessions
Hello all, I am interested in using BackgrounDRb to clear out ActiveRecord based sessions. I have this working, just with a small hitch, here is the code: class ClearSessionsWorker < BackgrounDRb::Rails repeat_every 7.minutes first_run Time.now def do_work(args) Session.destroy_all(["updated_at < ?", 20.minute.ago ]) end end It''s not very complicated and does remove sessions, it''s just that once the job is done, the thread hangs out leaving a connection to my databas...
2006 Sep 23
6
Connection to backgroundrb is lost when exiting action method
Hey. I have a very annoying problem, and was wondering what is wrong. Suppose I have backgroundrb running, and then I have an action in some controller. In the action I define a worker. When leaving the action, suddenly the connection to backgroundrb is lost: DRb URI: druby://localhost:22222 Pid: 3976 Autostart... done druby://localhost:42531 - #<Errno::EBADF: Bad file descriptor -
2006 Aug 01
2
making backgroundrb cron
...st two of my projects where i would need such a facility) and if so, how could the configuration be done? best would be something that can be changed and added by runtime while being preserved over various starts and stops... or something of rails magic: class FooWorker < BackgrounDRb::Rails repeat_every 24.hours start_at tomorrow.midnight def do_work @logger.info ''i will appear on midnight every day from now!'' end end but since thats magic, i dont really know how that would work, but its more the rails way than an entry in backgroundrb.yml i think what do you think o...
2006 Sep 28
2
Duplicate record weirdness ?
...updates that log record. Fair enough. All is working beautfiully and this is the perfect candidate for using with backgroundRb. First couple of runs through it worked perfectly. Then things started going wonky. My worker is as simple as this.. class FilemakerSyncWorker < BackgrounDRb::Rails repeat_every 20.minutes first_run Time.now def do_work(args) Syncer.new.synchronise end end What''s really weird, and maybe is my complete lack of understanding of threads and such like is this, randomly, throughout the day the log records created in .synchronise are getting *almost* duplicat...
2006 Oct 16
6
accessing session data in worker
Is there something special I need to do to access session data in a worker? I''m using an AR session store. I''ve been working with Ezra''s tutorial, modifying it a little here and there to figure it out. So I changed the progress bar to a simple count-down in the worker which sends back the count to display in the view. No big deal. But if I try to access session
2006 Oct 30
11
BackgrounDRb 0.2.0 Release! Complete rewrite.
...heartbeat setup between parent and child processes so that if you kill the parent, all children processes are killed off the next time they try to hearbeat. All of this happens transparently to you as a user. The new release comes with a brand new job scheduler. You can use simple triggers like repeat_every or you can get more complex and use full cron compatible syntax. Workers can be scheduled by two built in ''trigger'' types. A simple ''trigger'' is specified with start, stop and interval: require ''active_support'' MiddleMan.schedule_worker(...
2006 Oct 30
1
new BackgroundRB
...at if > > you kill the parent, all children processes are killed off the next > > time they try to > > hearbeat. All of this happens transparently to you as a user. > > > > The new release comes with a brand new job scheduler. You can use > > simple triggers like repeat_every or you can get more complex and use > > full cron compatible syntax. > > > > Workers can be scheduled by two built in ''trigger'' types. A simple > > ''trigger'' is specified with start, stop and interval: > > > > require '&...