This commit is contained in:
2023-03-30 18:24:05 +08:00
parent f922c209a8
commit ea90aebd62
+2 -14
View File
@@ -159,7 +159,6 @@ class Server extends HttpService
/** /**
* @return void * @return void
* @throws ConfigException * @throws ConfigException
* @throws ReflectionException
* @throws Exception * @throws Exception
*/ */
public function onHotReload(): void public function onHotReload(): void
@@ -167,23 +166,12 @@ class Server extends HttpService
$this->onWorkerListener(); $this->onWorkerListener();
$reload = Config::get('reload.hot', false); $reload = Config::get('reload.hot', false);
if ($reload !== false) { if ($reload !== false) {
$this->provider->on(OnWorkerStart::class, [$this, 'LoadRoutingList']); $this->provider->on(OnWorkerStart::class, [$this->router, 'scan_build_route']);
$this->manager->addProcess(Kiri\Reload\Inotify::class); $this->manager->addProcess(Kiri\Reload\Inotify::class);
} else { } else {
$this->LoadRoutingList();
}
}
/**
* @return void
* @throws ReflectionException
* @throws Exception
*/
public function LoadRoutingList(): void
{
$this->router->scan_build_route(); $this->router->scan_build_route();
} }
}
/** /**