[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:

  :class: :document_sorter_worker
  :worker_method: :do_work
  :job: :bleh
    :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


Basically does nothing but log that it's running.

After running "script/server run" this is what I have in

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:
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:
20061120-17:04:52 (31960) Loading Sechedule:
Nov 20 17:04:57 CST 2006endMon Nov 20 17:04:52 CST 2006jobbleh

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.

More information about the Backgroundrb-devel mailing list