[Backgroundrb-devel] cron trigger problem

Paul Kmiec paul.kmiec at appfolio.com
Tue Apr 8 14:23:14 EDT 2008


Hi,

I am playing around with backgroundrb 1.0.3. I have the following
backgroundrb.yml,

---
:backgroundrb:
  :port: 11006
  :ip: 0.0.0.0

:schedules:
  :task_worker:
    :run:
      :trigger_args: */10 * * * * *


My task worker is just,

class TaskWorker < BackgrounDRb:MetaWorker
  set_worker_name :task_worker
  def run
    logger.info "begin"
    sleep 60
    logger.info "end"
  end
end

After seeing a few begin's and end's in the log, I get the following exception:

/Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/cron_trigger.rb:119:in
`parse': wrong number of arguments (2 for 1) (ArgumentError)
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/cron_trigger.rb:119:in
`fire_after_time'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/cron_trigger.rb:21:in
`loop'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/cron_trigger.rb:21:in
`fire_after_time'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/meta_worker.rb:336:in
`check_for_timer_events'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/meta_worker.rb:325:in
`each'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/meta_worker.rb:325:in
`check_for_timer_events'
	from /Library/Ruby/Gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:125:in
`start_reactor'
	from /Library/Ruby/Gems/1.8/gems/packet-0.1.5/lib/packet/packet_core.rb:124:in
`loop'
	 ... 6 levels...
	from /Library/Ruby/Gems/1.8/gems/packet-0.1.5/lib/packet/packet_master.rb:20:in
`run'
	from /Users/pkmiec/src/propertyadmin/trunk/vendor/plugins/backgroundrb/server/lib/master_worker.rb:166:in
`initialize'
	from script/backgroundrb:60:in `new'
	from script/backgroundrb:60

Line 119 is,
next_min = Chronic.parse("next minute",:now => current_time)

Not sure what is going on since cron trigger does work correctly few
times before this error occurs. Is it possible for Chronic to be
reloaded? I am running in development mode with chronic (0.2.3).

Has anyone seen something similar? Obviously, I can run my task every
10 secs using the add_periodic_timer, but I was hoping to use
cron-style config.

Thanks,
Paul


More information about the Backgroundrb-devel mailing list