@@ -122,7 +122,7 @@ public function beforeSwooleStart()
122122 } else {
123123 $ reloadProcess = new \swoole_process (function ($ process ) {
124124 new Inotify ($ this ->config , $ this );
125- $ this ->onWorkerStart ($ this ->server , 0 );
125+ $ this ->onWorkerStart ($ this ->server , null );
126126 }, false , 2 );
127127 $ this ->server ->addProcess ($ reloadProcess );
128128 }
@@ -132,7 +132,7 @@ public function beforeSwooleStart()
132132 if ($ this ->config ->get ('config_manage_enable ' , false )) {
133133 $ configProcess = new \swoole_process (function ($ process ) {
134134 new Config ($ this ->config , $ this );
135- $ this ->onWorkerStart ($ this ->server , 0 );
135+ $ this ->onWorkerStart ($ this ->server , null );
136136 }, false , 2 );
137137 $ this ->server ->addProcess ($ configProcess );
138138 }
@@ -141,7 +141,7 @@ public function beforeSwooleStart()
141141 if ($ this ->config ->get ('user_timer_enable ' , false )) {
142142 $ timerProcess = new \swoole_process (function ($ process ) {
143143 new Timer ($ this ->config , $ this );
144- $ this ->onWorkerStart ($ this ->server , 0 );
144+ $ this ->onWorkerStart ($ this ->server , null );
145145 }, false , 2 );
146146 $ this ->server ->addProcess ($ timerProcess );
147147 }
@@ -476,7 +476,8 @@ public function onWorkerStart($serv, $workerId)
476476 {
477477 // Worker类型
478478 if (!$ this ->isTaskWorker ()) {
479- if ($ this ->processType == Marco::PROCESS_WORKER ) {
479+ if ($ workerId !== null ) {
480+ $ this ->processType = Marco::PROCESS_WORKER ;
480481 getInstance ()->sysTimers [] = swoole_timer_tick (2000 , function ($ timerId ) {
481482 $ this ->statistics ();
482483 });
0 commit comments