:-D Thanks Niphold, using repeats = 2 and no stop_time is the best
solution. I did not realize that I could do it that way.

Thanks again.

Best regards.


2013/8/3 Niphlod <[email protected]>

> ok, explanation is clearer. Although scheduler was not meant to be
> executing task on a precise-timing (its a queue processor, not cron), but
> instead it executes the tasks that are available, all that is needed is for
> you to understand how it works.
>
> It's not as precise as cron, because scheduler polls every x seconds the
> scheduler_task table to see if there is anything to do, and then spawns a
> process to execute the task.
> If you need your mails to start exactly at 12:00:00 and at 14:00:00, I'm
> assuming you understood how to make it work in the wrong way.
>
> Scheduling a start_time of 12:00:00 and a stop_time of 14:00:00 assures
> you that no tasks will be picked before 12:00:00 and later than 14:00:00.
> If you need that task to fire two times only, then setting a period of 4
> hours will never get you 2 executions, because if the first task is picked
> around 12:00:00 it will be "rescheduled" for execution 4 hours later, at
> 16:00:00. The point is, you set the task to never execute past 14:00:00, so
> the second execution will never take place at 16:00:00.
>
> Be careful though: the scheduler can "spend" some seconds of "sleep"
> before picking the tasks, so calculating those times so precisely can get
> you in the situation where you set 12:00:00 as start_time, 14:00:00 at
> stop_time and 7200 as period, but never get to the second execution.
>
> That's because scheduler uses the time the task was picked up (that may
> very well be 12:00:05) to calculate the next time a task will be
> effectively be able to be picked up, and in that case, it will be 14:00:05.
>
> If so, you have a few choices (based on your loads - meaning how many
> concurrent task you may have at 12:00:00), the simplest of them all (given
> your current mindset) is to set stop_time at 14:01:00 instead of 14:00:00,
> assuming you can "forgive" that one minute ahead.
>
> But, if I understood your requirements, why don't you just use repeats=2,
> start_time=12:00:00, period=7200 and no stop_time at all ?
> This will guarantee that the first execution will take place after
> 12:00:00 (again, assuming a normal load, it could be picked up a few
> seconds later, e.g. 12:00:15) and the second one at , e.g., 14:00:15 , and
> then the task will result as COMPLETED after exactly 2 executions.
>
>
>
>  --
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to