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