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