[Backgroundrb-devel] schedule support on latest svn, a question

Eduardo Dominguez eduardodmz at gmail.com
Mon Nov 20 18:21:02 EST 2006


I'm running the latest backgroundrb mainly for scheduled tasks support.

As per the documentation I created the backgroundrb_schedules.yml with
the following:

simple_label:
  :class: :document_sorter_worker
  :worker_method: :do_work
  :job: :bleh
  :trigger_args:
    :start: <%= Time.now + 5.seconds %>
    :end: <%= Time.now + 10.minutes
    :repeat_interval: 1.minute

Under lib/workers I have the following class:

class DocumentSorterWorker < BackgrounDRb::Worker::RailsBase

  def do_work(args)
    logger.info('DocumentSorterWorker do work')
    results[:do_work_time] = Time.now.to_s
    results[:done_with_do_work] ||= true
  end

end
DocumentSorterWorker.register

Basically does nothing but log that it's running.

After running "script/server run" this is what I have in
backgroundrb_server.log:

20061120-17:04:52 (31960) port: 2000
20061120-17:04:52 (31960) worker_dir: /home/ed/Documents/test/lib/workers
20061120-17:04:52 (31960) protocol: drbunix
20061120-17:04:52 (31960) uri: drbunix:///tmp/backgroundrbunix_localhost_2000
20061120-17:04:52 (31960) config:
/home/ed/Documents/test/config/backgroundrb.yml
20061120-17:04:52 (31960) rails_env: development
20061120-17:04:52 (31960) Starting worker:
BackgrounDRb::Worker::WorkerLogger backgroundrb_logger
(backgroundrb_logger) ()
20061120-17:04:52 (31960) Starting worker:
BackgrounDRb::Worker::WorkerResults backgroundrb_results
(backgroundrb_results) ()
20061120-17:04:52 (31960) Loading Worker Class File:
/home/ed/Documents/test/lib/workers/document_sorter_worker.rb
20061120-17:04:52 (31960) Loading Sechedule:
argsclassdocument_sorter_worker
trigger_typetriggerworker_methoddo_workworker_method_argsclassdocument_sorter_workertrigger_argsrepeat_interval1.minutestartMon
Nov 20 17:04:57 CST 2006endMon Nov 20 17:04:52 CST 2006jobbleh
#<BackgrounDRb::Trigger:0xb76b66d4>

As far as I can tell backgroundrb loads my worker but I don't see any
indication that its being ran every minute. At least not in
development.log and backgroundrb_server.log

Am I missing something ?

Thanks in advance.
-- 
Lalo


More information about the Backgroundrb-devel mailing list