Brian Lucas
2007-Feb-18 23:50 UTC
[Backgroundrb-devel] backgroundrb launches concurrent instances of same job
Hi there, Backgroundrb is working pretty well for me but I have a job that launches two of the same job, apparently a minute(?) apart from each other. Should this be happening if I have repeat interval enabled with a job_key? It seems like it should wait until the job is finished before launching a new instance. --Backgroundrb_schedules.yml-- city_updater: :class: :city_updater_worker :job_key: :city_updater :worker_method: :do_work :worker_method_args: scheduled workers require some args, so here you go... :trigger_args: :start: <%= Time.now + 5.seconds %> :repeat_interval: <%= 1.minutes %> It''s currently launching two instances of city_updater, one minute apart fro the other. Hints or tips to avoid this appreciated! Brian
skaar
2007-Feb-19 01:35 UTC
[Backgroundrb-devel] backgroundrb launches concurrent instances of same job
* Brian Lucas (blucasco at gmail.com) [070218 17:48]:> Hi there, > Backgroundrb is working pretty well for me but I have a job that launches > two of the same job, apparently a minute(?) apart from each other. Should > this be happening if I have repeat interval enabled with a job_key? It > seems like it should wait until the job is finished before launching a new > instance. > > --Backgroundrb_schedules.yml-- > city_updater: > :class: :city_updater_worker > :job_key: :city_updater > :worker_method: :do_work > :worker_method_args: scheduled workers require some args, so here you > go... > :trigger_args: > :start: <%= Time.now + 5.seconds %> > :repeat_interval: <%= 1.minutes %> > > It''s currently launching two instances of city_updater, one minute apart fro > the other.you see these as processes or as log entries? /skaar -- ---------------------------------------------------------------------- |\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n | | >=========== W.A.S.T.E. | genarratologies |/|/ (_) is the wisdom | skaar at waste.org ----------------------------------------------------------------------
Brian Lucas
2007-Feb-19 16:26 UTC
[Backgroundrb-devel] backgroundrb launches concurrent instances of same job
A logger entry lets me know what action is being performed by the job. The job iterates through a loop and I see two different "loops" that being worked on simultaneously. The loop is a simple ruby loop: category=Category.find(...) Locations.each { |location| logger.info(''Category:''+category+'' CityUpdater: starting city ''+city) ...do work here... } It''s strange that it''s launching two instances. -----Original Message----- From: skaar [mailto:skaar at waste.org] Sent: Sunday, February 18, 2007 6:36 PM To: Brian Lucas Cc: backgroundrb-devel at rubyforge.org Subject: Re: [Backgroundrb-devel] backgroundrb launches concurrent instances of same job * Brian Lucas (blucasco at gmail.com) [070218 17:48]:> Hi there, > Backgroundrb is working pretty well for me but I have a job that launches > two of the same job, apparently a minute(?) apart from each other. Should > this be happening if I have repeat interval enabled with a job_key? It > seems like it should wait until the job is finished before launching a new > instance. > > --Backgroundrb_schedules.yml-- > city_updater: > :class: :city_updater_worker > :job_key: :city_updater > :worker_method: :do_work > :worker_method_args: scheduled workers require some args, so here you > go... > :trigger_args: > :start: <%= Time.now + 5.seconds %> > :repeat_interval: <%= 1.minutes %> > > It''s currently launching two instances of city_updater, one minute apartfro> the other.you see these as processes or as log entries? /skaar -- ---------------------------------------------------------------------- |\|\ where in the | s_u_b_s_t_r_u_c_t_i_o_n | | >=========== W.A.S.T.E. | genarratologies |/|/ (_) is the wisdom | skaar at waste.org ----------------------------------------------------------------------