From 4e4093e76c3d75497abab46e98139f655350a835 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Mon, 19 Aug 2019 10:25:05 +0100 Subject: [PATCH] Add sleep to avoid hogging CPU closes PhpGt/Daemon#4 --- src/Command/AbstractWebEngineCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Command/AbstractWebEngineCommand.php b/src/Command/AbstractWebEngineCommand.php index e015e41..1e1878c 100644 --- a/src/Command/AbstractWebEngineCommand.php +++ b/src/Command/AbstractWebEngineCommand.php @@ -86,6 +86,8 @@ public function executeScript( if(strlen(trim($errorOutput)) > 0) { $this->write($errorOutput, Stream::ERROR); } + + usleep(100000); } while($processPool->numRunning() > 0); }