feat: killing port on start

This commit is contained in:
Chubby Granny Chaser 2025-02-16 21:41:34 +00:00
parent 4f725d08dc
commit f1e47fc303
No known key found for this signature in database
3 changed files with 21 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import updater from "electron-updater";
import i18n from "i18next";
import path from "node:path";
import url from "node:url";
import kill from "kill-port";
import { electronApp, optimizer } from "@electron-toolkit/utils";
import { logger, WindowManager } from "@main/services";
import resources from "@locales";
@ -58,7 +59,7 @@ app.whenReady().then(async () => {
return net.fetch(url.pathToFileURL(decodeURI(filePath)).toString());
});
await loadState();
await kill(PythonRPC.RPC_PORT).finally(() => loadState());
const language = await db.get<string, string>(levelKeys.language, {
valueEncoding: "utf-8",