Task: Remove currentTick parameter (#3498)

This parameter is not used for the vast majority of task use cases and just serves as extra useless boilerplate code, especially for closure-based tasks.
This use case can be replaced using Server->getTick() in the cases where it matters.
This commit is contained in:
Dylan T
2020-05-16 15:28:45 +01:00
committed by GitHub
parent 38e28f91e8
commit 67666db827
6 changed files with 21 additions and 21 deletions

View File

@ -147,7 +147,7 @@ class TaskScheduler{
unset($this->tasks[$task->getTaskId()]);
continue;
}
$task->run($this->currentTick);
$task->run();
if($task->isRepeating()){
$task->setNextRun($this->currentTick + $task->getPeriod());
$this->queue->insert($task, $this->currentTick + $task->getPeriod());