Eduardo Dominguez
2006-Nov-20 23:21 UTC
[Backgroundrb-devel] schedule support on latest svn, a question
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
skaar
2006-Nov-20 23:34 UTC
[Backgroundrb-devel] schedule support on latest svn, a question
* Eduardo Dominguez (eduardodmz at gmail.com) [061120 17:31]:> 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.minuteI should probably remove the active_support reference in the docs, what if you try to just to: :repeat_interval: 60 (repeat interval is in seconds) /skaar
Eduardo Dominguez
2006-Nov-21 03:58 UTC
[Backgroundrb-devel] schedule support on latest svn, a question
Skaar, thanks a lot, that did it. :) On 11/20/06, skaar <skaar at waste.org> wrote:> * Eduardo Dominguez (eduardodmz at gmail.com) [061120 17:31]: > > 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 > > I should probably remove the active_support reference in the docs, what > if you try to just to: > > :repeat_interval: 60 > > (repeat interval is in seconds) > /skaar > >-- Lalo