This commit is contained in:
as2252258@163.com
2021-04-09 03:02:04 +08:00
parent b3fb617815
commit 392d21de55
+7 -7
View File
@@ -54,13 +54,13 @@ class OnWorkerStart extends Callback
public function onHandler(Server $server, int $worker_id): void
{
$annotation = $this->injectLoader();
(new Pipeline())
->if($this->isWorker($worker_id), function ($annotation, $server, $worker_id) {
$annotation->runtime(CONTROLLER_PATH);
$annotation->runtime(APP_PATH, CONTROLLER_PATH);
$this->onWorker($server, $server->worker_id);
name($server->worker_pid, 'Worker.' . $worker_id);
})
$line = new Pipeline();
$line->if($this->isWorker($worker_id), function ($annotation, $server, $worker_id) {
$annotation->runtime(CONTROLLER_PATH);
$annotation->runtime(APP_PATH, CONTROLLER_PATH);
$this->onWorker($server, $server->worker_id);
name($server->worker_pid, 'Worker.' . $worker_id);
})
->else(function ($annotation, $server, $worker_id) {
$annotation->runtime(MODEL_PATH);
$this->onTask($server, $server->worker_id);