[Backgroundrb-devel] Scheduling same worker/method at different times with different args

Scott Ward scott at shefield.com
Mon Jan 28 14:32:21 EST 2008


I need to run the same worker's method twice per day with different
arguments.  Unfortunately, only the second entry in the schedule is firing.

I created an experimental worker to verify this:

Worker:
class ExperimentWorker < BackgrounDRb::MetaWorker
  set_worker_name :experiment_worker
  def create(args = nil)
    # this method is called, when worker is loaded for the first time
  end
  
  def experiment(args = {})
    logger.info "#{Time.now} - Experiment fired at #{args[:repeat_second]}
second mark."
  end
end


In backgroundrb.yml:
:schedules:
  :experiment_worker:
    :experiment:
      :trigger_args: "0 * * * * * *"
      :data:
        :repeat_second: zero
    :experiment:
      :trigger_args: "30 * * * * * *"
      :data:
        :repeat_second: thirty


In the log, I only see "Experiment fired at thirty second mark."  Why isn't
the first entry for experiment worker firing?  Perhaps, I have this set up
wrong?

Thanks,

Scott



More information about the Backgroundrb-devel mailing list