mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
schedule next run before executing current run
This commit is contained in:
parent
be7aa1b4a8
commit
73d27bc82b
|
@ -84,10 +84,14 @@ foreach($tasks as $task) {
|
||||||
if(method_exists($taskobj, 'execute')) {
|
if(method_exists($taskobj, 'execute')) {
|
||||||
if(!$task->getDisabled() && $task->isDue()) {
|
if(!$task->getDisabled() && $task->isDue()) {
|
||||||
if($mode == 'run') {
|
if($mode == 'run') {
|
||||||
echo get_class($task);
|
/* Schedule the next run right away to prevent a second execution
|
||||||
|
* of the task when the cron job of the scheduler is called before
|
||||||
|
* the last run was finished. The task itself can still be scheduled
|
||||||
|
* to fast, but this is up to the admin of seeddms.
|
||||||
|
*/
|
||||||
|
$task->updateLastNextRun();
|
||||||
if($taskobj->execute($task)) {
|
if($taskobj->execute($task)) {
|
||||||
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
|
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." successful.");
|
||||||
$task->updateLastNextRun();
|
|
||||||
} else {
|
} else {
|
||||||
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." failed, task has been disabled.", PEAR_LOG_ERR);
|
add_log_line("Execution of task ".$task->getExtension()."::".$task->getTask()." failed, task has been disabled.", PEAR_LOG_ERR);
|
||||||
$task->setDisabled(1);
|
$task->setDisabled(1);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user