Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

feat: implement Plexo download manager with React UI, download engine, and e2e test suite

Ambaliya Prashant Vrajlal794b4cf463c5
diff --git a/src/main/index.ts b/src/main/index.ts
index 8cfb172..5dd5d0c 100644
--- a/src/main/index.ts
+++ b/src/main/index.ts
@@ -123,9 +123,16 @@ app.on('before-quit', (event) => {
if (quitAfterSuspending || !downloadManager) return
event.preventDefault()
+
+ // Guarantee the process exits even if suspending hangs
+ const forceQuitTimeout = setTimeout(() => {
+ app.exit(0)
+ }, 3000)
+
void downloadManager.suspendAll().finally(() => {
+ clearTimeout(forceQuitTimeout)
quitAfterSuspending = true
- app.quit()
+ app.exit(0)
})
})
diff --git a/src/preload/index.d.ts b/src/preload/globals.d.ts
similarity index 100%
rename from src/preload/index.d.ts
rename to src/preload/globals.d.ts
diff --git a/tsconfig.e2e.json b/tsconfig.e2e.json
index bb9e502..e7fe5ed 100644
--- a/tsconfig.e2e.json
+++ b/tsconfig.e2e.json
@@ -1,6 +1,6 @@
{
"extends": "@electron-toolkit/tsconfig/tsconfig.node.json",
- "include": ["e2e/**/*", "playwright.config.ts", "src/preload/index.d.ts"],
+ "include": ["e2e/**/*", "playwright.config.ts", "src/preload/globals.d.ts"],
"compilerOptions": {
"noEmit": true,
"lib": ["ESNext", "DOM"]