Project

General

Profile

Bug #92399 » typo3_fix_scheduler_loop.patch

Rémy DANIEL, 2020-09-25 18:43

View differences:

typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php 2020-09-24 16:27:18.304073534 +0200 → typo3/sysext/scheduler/Classes/Command/SchedulerCommand.php 2020-09-24 16:26:54.904000000 +0200
try {
$task = $this->scheduler->fetchTask();
try {
$this->scheduler->executeTask($task);
$this->executeTaskInSubProcess($task);
} catch (\Exception $e) {
// We ignore any exception that may have been thrown during execution,
// as this is a background process.
......
// Record the run in the system registry
$this->scheduler->recordLastRun();
}
/**
* Execute task in a new php process with the same environment.
*
* @param AbstractTask $task
*/
protected function executeTaskInSubProcess(AbstractTask $task)
{
$process = new \Symfony\Component\Process\Process([
PATH_site . 'typo3/sysext/core/bin/typo3',
'scheduler:run',
'--task', $task->getTaskUid()
]);
$process->setTimeout(null);
$process->setIdleTimeout(null);
$process->mustRun();
}
}
    (1-1/1)