mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 09:26:06 +00:00
Merge branch 'minor-next' into major-next
This commit is contained in:
@ -1668,9 +1668,11 @@ class Server{
|
||||
$this->isRunning = false;
|
||||
|
||||
//Force minimum uptime to be >= 120 seconds, to reduce the impact of spammy crash loops
|
||||
$spacing = ((int) $this->startTime) - time() + 120;
|
||||
$uptime = time() - ((int) $this->startTime);
|
||||
$minUptime = 120;
|
||||
$spacing = $minUptime - $uptime;
|
||||
if($spacing > 0){
|
||||
echo "--- Waiting $spacing seconds to throttle automatic restart (you can kill the process safely now) ---" . PHP_EOL;
|
||||
echo "--- Uptime {$uptime}s - waiting {$spacing}s to throttle automatic restart (you can kill the process safely now) ---" . PHP_EOL;
|
||||
sleep($spacing);
|
||||
}
|
||||
@Process::kill(Process::pid());
|
||||
|
Reference in New Issue
Block a user