fix: 修复pnpm ksr重启失败,修复状态不清零

Signed-off-by: 千奈千祁 <2632139786@qq.com>
This commit is contained in:
千奈千祁 2024-06-03 10:06:12 +00:00 committed by Gitee
parent 72ea0081d5
commit e4a0eb7524
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 2 deletions

View File

@ -83,6 +83,7 @@ class PluginsLoader {
* @param isRefresh 是否刷新
*/
async load(isRefresh = false) {
this.delCount()
if (isRefresh) this.priority = []
if (this.priority.length) return

View File

@ -36,10 +36,10 @@ const serverHttpexit = http.createServer(async (req, res) => {
return
}
if (req.url === `/restart`) {
await serverProcess.kill();
await startServer();
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('OK\n');
await serverProcess.kill();
await startServer();
} else if (req.url === `/exit`) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('OK\n');