TaskScheduler: remove redundant else branch

This commit is contained in:
Dylan K. Taylor 2018-05-31 13:01:06 +01:00
parent f2b8d6879f
commit 6b4b4e4bb1

View File

@ -197,14 +197,13 @@ class TaskScheduler{
if($task->isCancelled()){ if($task->isCancelled()){
unset($this->tasks[$task->getTaskId()]); unset($this->tasks[$task->getTaskId()]);
continue; continue;
}else{ }
try{ try{
$task->run($this->currentTick); $task->run($this->currentTick);
}catch(\Throwable $e){ }catch(\Throwable $e){
$this->logger->critical("Could not execute task " . $task->getTaskName() . ": " . $e->getMessage()); $this->logger->critical("Could not execute task " . $task->getTaskName() . ": " . $e->getMessage());
$this->logger->logException($e); $this->logger->logException($e);
} }
}
if($task->isRepeating()){ if($task->isRepeating()){
$task->setNextRun($this->currentTick + $task->getPeriod()); $task->setNextRun($this->currentTick + $task->getPeriod());
$this->queue->insert($task, $this->currentTick + $task->getPeriod()); $this->queue->insert($task, $this->currentTick + $task->getPeriod());