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 +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,21 @@ 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+ $ queueConfig = $ this ->laravel ->make ('config ' )->get ('queue ' );
224+
225+ // lookup for set swoole driver
226+ $ isDefinedSwooleDriver = in_array (
227+ 'swoole ' ,
228+ array_column (
229+ $ queueConfig ['connections ' ] ?? [],
230+ 'driver '
231+ ),
232+ true
233+ ) || ($ queueConfig ['default ' ] ?? null ) === 'swoole ' ;
234+
235+ $ hasTaskWorker = $ isWebsocket || $ isDefinedSwooleDriver ;
236+
223237 $ logFile = Arr::get ($ this ->config , 'server.options.log_file ' );
224238 $ pids = $ this ->laravel ->make (PidManager::class)->read ();
225239 $ 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 set 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