From 99c5323d7751d1bd618d8121c7f22fb961c9238b Mon Sep 17 00:00:00 2001 From: chaz6chez Date: Tue, 23 Apr 2024 11:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8redis=20pub/sub=E4=BB=A3?= =?UTF-8?q?=E6=9B=BFchannel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/plugin/workbunny/webman-push-server/app.php | 10 ++++++---- .../plugin/workbunny/webman-push-server/process.php | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/config/plugin/workbunny/webman-push-server/app.php b/src/config/plugin/workbunny/webman-push-server/app.php index 4399a12..6b67528 100644 --- a/src/config/plugin/workbunny/webman-push-server/app.php +++ b/src/config/plugin/workbunny/webman-push-server/app.php @@ -33,13 +33,15 @@ // 推送服务配置 'push-server' => [ // redis通道 - 'redis_channel' => 'default', + 'redis_channel' => 'default', // 心跳检查,0为不检查 - 'heartbeat' => 60, + 'heartbeat' => 60, + // 是否使用redis替代channel + 'channel_substitution_enable' => false, // channel默认地址 - 'channel_host' => '127.0.0.1', + 'channel_host' => '127.0.0.1', // channel默认端口 - 'channel_port' => 2206, + 'channel_port' => 2206, // 验证app_key 'apps_query' => function (string $appKey, ?string $appId = null): array { diff --git a/src/config/plugin/workbunny/webman-push-server/process.php b/src/config/plugin/workbunny/webman-push-server/process.php index f010701..da4f065 100644 --- a/src/config/plugin/workbunny/webman-push-server/process.php +++ b/src/config/plugin/workbunny/webman-push-server/process.php @@ -42,7 +42,8 @@ 'count' => cpu_count(), 'reloadable' => false, // 执行reload不重启 'reusePort' => true - ], + ] +] + (config('plugin.workbunny.webman-push-server.app.push-server.channel_substitution_enable') ? [] : [ // channel server 'channel-server' => [ 'handler' => ChannelServer::class, @@ -51,4 +52,4 @@ 'reloadable' => false, // 执行reload不重启 'reusePort' => true ], -]; \ No newline at end of file +]); \ No newline at end of file