Remove tasks if processing requirements are false
[MAILPOET-2530]
This commit is contained in:
committed by
Jack Kitterhing
parent
dc5e2ae386
commit
371b6a2824
@ -47,15 +47,18 @@ abstract class SimpleWorker {
|
|||||||
|
|
||||||
// abort if execution limit is reached
|
// abort if execution limit is reached
|
||||||
$this->cron_helper->enforceExecutionLimit($timer);
|
$this->cron_helper->enforceExecutionLimit($timer);
|
||||||
|
$scheduled_tasks = $this->getDueTasks();
|
||||||
|
$running_tasks = $this->getRunningTasks();
|
||||||
|
|
||||||
if (!$this->checkProcessingRequirements()) {
|
if (!$this->checkProcessingRequirements()) {
|
||||||
|
foreach (array_merge($scheduled_tasks, $running_tasks) as $task) {
|
||||||
|
$task->delete();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
$scheduled_tasks = $this->getDueTasks();
|
|
||||||
$running_tasks = $this->getRunningTasks();
|
|
||||||
|
|
||||||
if (!$scheduled_tasks && !$running_tasks) {
|
if (!$scheduled_tasks && !$running_tasks) {
|
||||||
if (static::AUTOMATIC_SCHEDULING) {
|
if (static::AUTOMATIC_SCHEDULING) {
|
||||||
|
Reference in New Issue
Block a user