you should update also the "counters" (times_run and/or times_failed), and 
maybe other fields depending on how you scheduled it in the first place 
(e.g. update stop_time)....this never surfaced before as a need, but if we 
code a requeue_task() api, there will be a few situations where its hard to 
know afterwards how precisely a task was scheduled the first time. 
In a normal "one-time-only" task when you update the status column and the 
times_run (and optionally the stop_time) there will be no problems from the 
scheduler perspective, but can be a little bit "wrong" if you 
analyze/process tasks (such as the cs_monitor_plugin) later, just because 
e.g. a task scheduled to run 1 time only actually has two/more 
scheduler_run records.
The thing basically is: given that we can't - in a few situations - assure 
a consistent behaviour with a theoretical requeue_task(), we should leave 
it to the app's code...after all it's easy: with the scheduler "down" you 
queue a task and inspect the values of the just inserted row and you do the 
same thing when you need to requeue it (either updating or inserting a new 
identical one).

Feel free to ask further details if the above statements are not clear 
enough ^_^

On Sunday, July 28, 2013 3:26:18 PM UTC+2, Alan Etkin wrote:
>
> I have searched the manual and also in this group about re-runing an 
> already queued task (i.e. one with completed status), but it seems there's 
> no information available on this subject. I'm not sure it's a good practice 
> anyway.
>
> Suppose I want to set a task to run every time the scheduler instance 
> starts. So what I'd do is to check if a "start" task exists or else queue 
> it; if "start" exists and it is not queued, I want to update the task so it 
> is available again. It seems that the scheduler does not implement a task 
> update feature, so I suppose I could do db(...).update(status='QUEUED'). 
> Should I reuse the task in that way?
>

-- 

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