Skip to content

Commit

Permalink
refs #4903 before executing a scheduled task reschedule it to prevent…
Browse files Browse the repository at this point in the history
… multiple executions when multiple archiver are running
  • Loading branch information
tsteur committed Apr 2, 2014
1 parent 2f7d4c5 commit 934caa2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/TaskScheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,19 @@ private function doRunTasks()
}

$taskName = $task->getName();
if ($this->timetable->shouldExecuteTask($taskName)) {
$shouldExecuteTask = $this->timetable->shouldExecuteTask($taskName);

if ($this->timetable->taskShouldBeRescheduled($taskName)) {
$this->timetable->rescheduleTask($task);
}

if ($shouldExecuteTask) {
$this->isRunning = true;
$message = self::executeTask($task);
$this->isRunning = false;

$executionResults[] = array('task' => $taskName, 'output' => $message);
}

if ($this->timetable->taskShouldBeRescheduled($taskName)) {
$this->timetable->rescheduleTask($task);
}
}
}

Expand Down

0 comments on commit 934caa2

Please sign in to comment.