mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +00:00
TaskScheduler: remove redundant else branch
This commit is contained in:
parent
f2b8d6879f
commit
6b4b4e4bb1
@ -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());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user