mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
TaskScheduler: throw an exception if attempting to heartbeat a disabled scheduler
This commit is contained in:
@@ -130,6 +130,9 @@ class TaskScheduler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function mainThreadHeartbeat(int $currentTick) : void{
|
public function mainThreadHeartbeat(int $currentTick) : void{
|
||||||
|
if(!$this->enabled){
|
||||||
|
throw new \LogicException("Cannot run heartbeat on a disabled scheduler");
|
||||||
|
}
|
||||||
$this->currentTick = $currentTick;
|
$this->currentTick = $currentTick;
|
||||||
while($this->isReady($this->currentTick)){
|
while($this->isReady($this->currentTick)){
|
||||||
/** @var TaskHandler $task */
|
/** @var TaskHandler $task */
|
||||||
|
|||||||
Reference in New Issue
Block a user