From 3a496926c99da45c44f5c3219bb77ba81064ccf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 3 Mar 2021 19:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Events/OnWorkerStart.php | 3 +++ Kafka/Kafka.php | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HttpServer/Events/OnWorkerStart.php b/HttpServer/Events/OnWorkerStart.php index f70a31b3..b2cd193b 100644 --- a/HttpServer/Events/OnWorkerStart.php +++ b/HttpServer/Events/OnWorkerStart.php @@ -94,6 +94,9 @@ class OnWorkerStart extends Callback } else { $name = $prefix . ' worker: No.' . $worker_id; } + if (Snowflake::isMac()) { + return 1; + } return swoole_set_process_name($name); } diff --git a/Kafka/Kafka.php b/Kafka/Kafka.php index a72c6efd..bbab688f 100644 --- a/Kafka/Kafka.php +++ b/Kafka/Kafka.php @@ -52,7 +52,10 @@ class Kafka extends \Snowflake\Process\Process { try { $prefix = rtrim(Snowflake::app()->id, ':'); - swoole_set_process_name($prefix . ' Kafka Consumer ' . $kafkaServer['topic']); + + if (!Snowflake::isMac()) { + swoole_set_process_name($prefix . ' Kafka Consumer ' . $kafkaServer['topic']); + } [$config, $topic, $conf] = $this->kafkaConfig($kafkaServer); if (empty($config) && empty($topic) && empty($conf)) {