This commit is contained in:
2021-01-05 10:15:33 +08:00
parent c6411cc23f
commit 9ad16e7d70
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -35,11 +35,12 @@ class OnWorkerStart extends Callback
swoole_set_process_name($get_name);
}
putenv('workerId=' . $worker_id);
if ($worker_id >= $server->setting['worker_num']) {
fire(Event::SERVER_TASK_START);
putenv('workerId=Task.' . $worker_id);
return;
}
putenv('workerId=Worker.' . $worker_id);
Snowflake::setWorkerId($server->worker_pid);
$this->setWorkerAction($worker_id);
}