Skip to main content
Topic: Scheduled tasks failing (Read 5238 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Scheduled tasks failing

As far as I can tell, there is currently no way to know if a scheduled task failed (when in background).

The scheduled task may fail for several reasons, the two most important I can think of are: timeout, or broken query or file.
In these two cases there would be no trace that the task was run and failed.

I consider this a bug, and I have an idea on how to fix it that doesn't require db changes, so it should be fixable for 1.0, just want to track it down and get some feedback (just in case I messed something stupid).

What I have in mind:
move integrate_autotask_include to ScheduleTask.class.php (somewhere after $affected_rows is set)
before $affected_rows is set log the task with a negative time_taken and get the id of the log
run the task
update the log with the correct time_taken.

This way if time_taken is negative it means the task failed for some reason and we can highlight it into the log, otherwise everything was fine.
Bugs creator.
Features destroyer.
Template killer.