Fix for swoole error

This commit is contained in:
Eldad Fux
2021-01-15 19:19:48 +02:00
parent 4c1d5419f4
commit 8373be65d0
+5 -7
View File
@@ -18,8 +18,6 @@ require_once __DIR__.'/../init.php';
\cli_set_process_title('Functions V1 Worker');
Runtime::setHookFlags(SWOOLE_HOOK_ALL);
Console::success(APP_NAME.' functions worker v1 has started');
$environments = Config::getParam('environments');
@@ -29,11 +27,11 @@ $environments = Config::getParam('environments');
*/
$warmupStart = \microtime(true);
Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
// Co\run(function() use ($environments) { // Warmup: make sure images are ready to run fast 🚀
// Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
foreach($environments as $environment) {
go(function() use ($environment) {
// go(function() use ($environment) {
$stdout = '';
$stderr = '';
@@ -53,9 +51,9 @@ Co\run(function() use ($environments) { // Warmup: make sure images are ready t
if(!empty($stderr)) {
Console::error($stderr);
}
});
// });
}
});
// });
$warmupEnd = \microtime(true);
$warmupTime = $warmupEnd - $warmupStart;