Add provider background recovery lifecycle

This commit is contained in:
ZacharyZhang-NY committed 2026-05-23 20:34:26 -04:00
1 parent 08364c2571
commit e5946f25c8
12 files changed
+921 -130

No files matched your search

+6
View File
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
import { DatabaseConnection } from "./database/connection";
import { createMainWindow } from "./app/create-window";
import { registerIpcHandlers } from "./app/ipc-handlers";
import { startProviderBackgroundWorker } from "./app/provider-background-worker";
const __dirname = dirname(fileURLToPath(import.meta.url));
const hasSingleInstanceLock = app.requestSingleInstanceLock();
@@ -26,6 +27,10 @@ app.whenReady().then(() => {
mainWindow: win,
artifactRoot: join(profileDir, "artifacts"),
});
const stopProviderBackgroundWorker = startProviderBackgroundWorker({
db: connection.db,
mainWindow: win,
});
app.on("second-instance", () => {
if (win.isMinimized()) win.restore();
@@ -33,6 +38,7 @@ app.whenReady().then(() => {
});
app.on("before-quit", () => {
stopProviderBackgroundWorker();
connection.close();
});
});