modify
This commit is contained in:
@@ -34,13 +34,15 @@ class OnWorkerStart extends Callback
|
|||||||
putenv('worker=' . $worker_id);
|
putenv('worker=' . $worker_id);
|
||||||
|
|
||||||
$annotation = Snowflake::app()->getAnnotation();
|
$annotation = Snowflake::app()->getAnnotation();
|
||||||
// $annotation->read(directory('app'),'App');
|
if ($worker_id >= $server->setting['worker_num']) {
|
||||||
// $annotation->runtime(directory('app'));
|
$annotation->read(MODEL_PATH, 'App\Models');
|
||||||
|
$annotation->runtime(APP_PATH, [CONTROLLER_PATH, TASK_PATH, LISTENER_PATH]);
|
||||||
if ($worker_id < $server->setting['worker_num']) {
|
|
||||||
$this->onWorker($server, $annotation);
|
|
||||||
} else {
|
|
||||||
$this->onTask($server, $annotation);
|
$this->onTask($server, $annotation);
|
||||||
|
} else {
|
||||||
|
$annotation->read(directory('app'), 'App');
|
||||||
|
$annotation->runtime(directory('app'));
|
||||||
|
|
||||||
|
$this->onWorker($server, $annotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user