This repository was archived by the owner on Mar 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed
Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,19 @@ protected function showInfos()
219219 $ workerNum = Arr::get ($ this ->config , 'server.options.worker_num ' );
220220 $ taskWorkerNum = Arr::get ($ this ->config , 'server.options.task_worker_num ' );
221221 $ isWebsocket = Arr::get ($ this ->config , 'websocket.enabled ' );
222- $ hasTaskWorker = $ isWebsocket || Arr::get ($ this ->config , 'queue.default ' ) === 'swoole ' ;
222+
223+ // lookup for settled swoole driver
224+ $ isDefinedSwooleDriver = in_array (
225+ 'swoole ' ,
226+ array_column (
227+ $ queueConfig ['connections ' ] ?? [],
228+ 'driver '
229+ ),
230+ true
231+ ) || ($ queueConfig ['default ' ] ?? null ) === 'swoole ' ;
232+
233+ $ hasTaskWorker = $ isWebsocket || $ isDefinedSwooleDriver ;
234+
223235 $ logFile = Arr::get ($ this ->config , 'server.options.log_file ' );
224236 $ pids = $ this ->laravel ->make (PidManager::class)->read ();
225237 $ masterPid = $ pids ['masterPid ' ] ?? null ;
Original file line number Diff line number Diff line change @@ -181,8 +181,18 @@ protected function configureSwooleServer()
181181 $ config = $ this ->app ->make ('config ' );
182182 $ options = $ config ->get ('swoole_http.server.options ' );
183183
184+ // lookup for settled swoole driver
185+ $ isDefinedSwooleDriver = in_array (
186+ 'swoole ' ,
187+ array_column (
188+ $ config ->get ('queue.connections ' ),
189+ 'driver '
190+ ),
191+ true
192+ ) || $ config ->get ('queue.default ' ) === 'swoole ' ;
193+
184194 // only enable task worker in websocket mode and for queue driver
185- if ($ config -> get ( ' queue.default ' ) !== ' swoole ' && ! $ this ->isWebsocket ) {
195+ if (! $ isDefinedSwooleDriver && ! $ this ->isWebsocket ) {
186196 unset($ options ['task_worker_num ' ]);
187197 }
188198
You can’t perform that action at this time.
0 commit comments