Allow immediate processing of just prepared tasks in cron worker runner
Preparing simple worker tasks is super fast, because it just switches the state to null. But the processing of just prepared tasks required the second worker run and also second cron run. This change optimize the behavior and in case there is still time left it immediately starts processing the tasks. [MAILPOET-4684]
This commit is contained in:
committed by
Aschepikov
parent
05b441378d
commit
69ac29d0a7
@@ -73,6 +73,8 @@ class CronWorkerRunner {
|
||||
foreach ($dueTasks as $task) {
|
||||
$this->prepareTask($worker, $task);
|
||||
}
|
||||
// Re-fetch running tasks so that we can process tasks that were just prepared
|
||||
$runningTasks = $this->getRunningTasks($worker);
|
||||
foreach ($runningTasks as $task) {
|
||||
$this->processTask($worker, $task);
|
||||
}
|
||||
|
Reference in New Issue
Block a user