Hello everyone, I get some trouble with backgroundrb, and I hope finding some help right here :-) Here''s the case : Step 1 : A cron job is calling a given URL, each minute Step 2 : A controller, called by the previous step, is loading a new worker after some test : MiddleMan.new_worker( :worker => :urls_worker, :job_key => "url_" + url.id.to_s, :data => { :url => url.address, :from_public_form => false }) Step 3 : The worker works... or not. Randomly, the call to the worker just fail and the worker is not loaded, but backgroundrb is working anyway. When the call failed once, i''ve got to kill and restart (most of the time, more than once) backgroudrb to make it works again. Thanks per advance... -- Bousmanne C?dric Jabber / XMPP : akyrho at gmail.com Mail : akyrho at gmail.com Blog : http://www.parenthese.be/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080711/f0c3f18e/attachment.html>
On Fri, Jul 11, 2008 at 4:40 PM, C?dric <akyrho at gmail.com> wrote:> Hello everyone, > > I get some trouble with backgroundrb, and I hope finding some help right > here :-) > > Here''s the case : > > Step 1 : A cron job is calling a given URL, each minute > > Step 2 : A controller, called by the previous step, is loading a new worker > after some test : > > MiddleMan.new_worker( > :worker => :urls_worker, > :job_key => "url_" + url.id.to_s, > :data => { :url => url.address, :from_public_form => false > }) > > Step 3 : The worker works... or not. Randomly, the call to the worker just > fail and the worker is not loaded, but backgroundrb is working anyway. > > When the call failed once, i''ve got to kill and restart (most of the time, > more than once) backgroudrb to make it works again. >It could be because, you can''t reuse job_keys while starting new workers as reported in previous mail.
Raghu Srinivasan
2008-Jul-11 16:47 UTC
[Backgroundrb-devel] cronjob, backgroundrb and crashes
Cedric, I do something very similar (cron->URL wget ->Rails controller -> BDRb jobs kicked off) and BDRb does great. Just make sure that your job key is unique each time. Generate a random string if you don''t care or you can use a timestamp or even some DB id/key if you want to keep track of it somewhere. Raghu On Fri, Jul 11, 2008 at 5:29 AM, hemant <gethemant at gmail.com> wrote:> On Fri, Jul 11, 2008 at 4:40 PM, C?dric <akyrho at gmail.com> wrote: > > Hello everyone, > > > > I get some trouble with backgroundrb, and I hope finding some help right > > here :-) > > > > Here''s the case : > > > > Step 1 : A cron job is calling a given URL, each minute > > > > Step 2 : A controller, called by the previous step, is loading a new > worker > > after some test : > > > > MiddleMan.new_worker( > > :worker => :urls_worker, > > :job_key => "url_" + url.id.to_s, > > :data => { :url => url.address, :from_public_form => > false > > }) > > > > Step 3 : The worker works... or not. Randomly, the call to the worker > just > > fail and the worker is not loaded, but backgroundrb is working anyway. > > > > When the call failed once, i''ve got to kill and restart (most of the > time, > > more than once) backgroudrb to make it works again. > > > > It could be because, you can''t reuse job_keys while starting new > workers as reported in previous mail. > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080711/9e2b22cb/attachment.html>