[Backgroundrb-devel] cron scheduling problem

Tom Wood thomas.a.wood at uconn.edu
Thu Jan 31 11:48:25 EST 2008


I'm running a fresh checkout of release 1.0.1 ...

 

It's now 11:32 am local time on January 31.

 

I've configured a single worker for a test.

 

If I use the following schedule in my background.yaml file:

 

:schedules:

  :debugger_worker:

    :ping:

      :trigger_args: 0 35 11 * * * *

 

Backgroundrb starts up without error.

 

If I make the following change:

 

      :trigger_args: 0 30 11 * * * *

 

Backgroundrb complains:

 

brb-test/vendor/plugins/backgroundrb/server/cron_trigger.rb:161:in
`local': argument out of range (ArgumentError)

        from
brb-test/vendor/plugins/backgroundrb/server/cron_trigger.rb:161:in
`fire_time_after'

        from
brb-test/vendor/plugins/backgroundrb/server/meta_worker.rb:266:in
`new_load_schedule'

        from
brb-test/vendor/plugins/backgroundrb/server/meta_worker.rb:258:in `each'

        from
brb-test/vendor/plugins/backgroundrb/server/meta_worker.rb:258:in
`new_load_schedule'

        from
brb-test/vendor/plugins/backgroundrb/server/meta_worker.rb:183:in
`worker_init'

        from
brb-test/vendor/plugins/backgroundrb/framework/worker.rb:20:in
`start_worker'

        from
brb-test/vendor/plugins/backgroundrb/framework/packet_master.rb:134:in
`fork_and_load'

        from
brb-test/vendor/plugins/backgroundrb/framework/packet_master.rb:98:in
`load_workers'

        from
brb-test/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
`each'

        from
brb-test/vendor/plugins/backgroundrb/framework/packet_master.rb:93:in
`load_workers'

        from
brb-test/vendor/plugins/backgroundrb/framework/packet_master.rb:19:in
`run'

        from
brb-test/vendor/plugins/backgroundrb/server/master_worker.rb:163:in
`initialize'

        from script/backgroundrb:60:in `new'

        from script/backgroundrb:60

 

A puts added to cron_trigger.rb reveals why Time.local is failing.  When
the worker is scheduled to run at 11:35, Time.local is called ala:

 

Calling Time.local 0, 35, 11, 31, 1, 2008, 4, 31, false, EST

 

When the worker is scheduled to run at 11:30, Time.local fails and is
called:

 

Calling Time.local 0, 30, 11, 32, 1, 2008, 4, 31, false, EST

 

"32" is not a valid day of the month.

 

I think the error is dependent on the time that backgroundrb starts.
When I waited until 11:40, backgroundrb started to generate the same
exception for the 11:35 worker.

 

-Tom

 

Tom Wood

thomas.a.wood at uconn.edu <mailto:thomas.a.wood at uconn.edu> 

ITS Applications Developer

University of Connecticut Libraries

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080131/ab43b380/attachment.html 


More information about the Backgroundrb-devel mailing list