This commit is contained in:
2021-01-04 18:45:08 +08:00
parent 22b34ac0fc
commit 29fe4f59b2
4 changed files with 8 additions and 3 deletions
+3 -1
View File
@@ -34,6 +34,8 @@ class OnWorkerStart extends Callback
if (!empty($get_name) && !Snowflake::isMac()) {
swoole_set_process_name($get_name);
}
putenv('workerId=' . $worker_id);
if ($worker_id >= $server->setting['worker_num']) {
fire(Event::SERVER_TASK_START);
return;
@@ -65,7 +67,7 @@ class OnWorkerStart extends Callback
*/
private function get_process_name($socket, $worker_id): string
{
$prefix = rtrim(Config::get('id',false, 'system:'), ':');
$prefix = rtrim(Config::get('id', false, 'system:'), ':');
if ($worker_id >= $socket->setting['worker_num']) {
return $prefix . ': Task: No.' . $worker_id;
} else {