变更
This commit is contained in:
@@ -57,9 +57,6 @@ class OnServerWorker extends \Kiri\Server\Abstracts\Server
|
||||
*/
|
||||
public function onWorkerStart(Server $server, int $workerId): void
|
||||
{
|
||||
if ($server->setting[Constant::OPTION_ENABLE_COROUTINE] ?? false) {
|
||||
Runtime::enableCoroutine();
|
||||
}
|
||||
$this->dispatch->dispatch(new OnBeforeWorkerStart($workerId));
|
||||
set_env('environmental_workerId', $workerId);
|
||||
$this->status->setEnum(StatusEnum::START);
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ class Server extends HttpService
|
||||
return;
|
||||
}
|
||||
Coroutine::set([
|
||||
'hook_flags' => SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION,
|
||||
'hook_flags' => (SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL) ^ SWOOLE_HOOK_BLOCKING_FUNCTION,
|
||||
'enable_deadlock_check' => FALSE,
|
||||
'exit_condition' => function () {
|
||||
return Coroutine::stats()['coroutine_num'] === 0;
|
||||
|
||||
Reference in New Issue
Block a user