mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +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{
|
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 */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user