TaskScheduler: do not push cancelled repeating tasks back onto the queue

This commit is contained in:
Dylan K. Taylor 2021-04-19 13:23:03 +01:00
parent 8d1a1628de
commit 177b963d8e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -177,7 +177,7 @@ class TaskScheduler{
continue;
}
$task->run($this->currentTick);
if($task->isRepeating()){
if(!$task->isCancelled() && $task->isRepeating()){
$task->setNextRun($this->currentTick + $task->getPeriod());
$this->queue->insert($task, $this->currentTick + $task->getPeriod());
}else{