The scheduler is not as "precise" as you would because there are some 
design considerations to think of....

The "uber-costraint"  is that a worker can execute only one task at a time 
--> if the scheduler is busy with something else, queued tasks can be 
"delayed" down the line
If the worker is free, new tasks are checked every 5*heartbeats seconds, so 
(unless immediate=True) you can get a timeframe for execution that spans in 
the worst case scenario with the default values by 15 seconds

This means that in the worst case scenario you could have a repeating task 
with a 300 seconds period that are actually executed every 315 seconds.

To clear out doubts, for repetitive tasks, as documented in more detail in 
the w2p_scheduler_tests app, the start time of the next execution is 
calculated adding period seconds after the start time of the current 
execution.
Lockings on the db can add more "imprecision", cause by the default the 
scheduler is eager to store/update whatever it needs to, to ensure 
consinstency between the real executions and the data stored on the tables.

On Monday, March 25, 2013 4:23:56 PM UTC+1, Paolo valleri wrote:
>
> Dear all, 
> I started to use scheduler. I've created a simple starting example task: 
> https://github.com/ilvalle/scapp/blob/master/models/scheduler.py
> and with the great niphlod's plugin cs_monitor_plugin I created an initial 
> repetitive task.
> However, although I set repeats: 0 and period: 300, tasks are not repeated 
> as expected exactly every 300s. The first five tasks were executed at:
> 2013-03-25 15:34:43
> 2013-03-25 15:40:48
> 2013-03-25 15:46:52
> 2013-03-25 15:52:08
> 2013-03-25 15:57:22
> The time between two consecutive execution is not so straightforward. what 
> am I missing? Is there a way to impose more accuracy ?
>
> paolo
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to