This commit is contained in:
as2252258@163.com
2021-02-27 04:18:44 +08:00
parent c83a98b50c
commit 6c35bc2b6c
+4 -2
View File
@@ -44,8 +44,10 @@ class OnWorkerStart extends Callback
Coroutine\go(function () use ($server) { Coroutine\go(function () use ($server) {
Coroutine::waitPid($server->worker_pid); Coroutine::waitPid($server->worker_pid);
}); });
$this->debug(sprintf('Worker #%d is start.....', $worker_id)); $name = ($worker_id >= $server->setting['worker_num'] ? 'Task' : 'Worker');
putenv('workerId=' . ($worker_id >= $server->setting['worker_num'] ? 'Task' : 'Worker') . '.' . $worker_id);
$this->debug(sprintf($name . ' #%d is start.....', $worker_id));
putenv('workerId=' . $name . '.' . $worker_id);
if ($worker_id >= $server->setting['worker_num']) { if ($worker_id >= $server->setting['worker_num']) {
fire(Event::SERVER_TASK_START); fire(Event::SERVER_TASK_START);
Coroutine\go(function () use ($server, $worker_id) { Coroutine\go(function () use ($server, $worker_id) {