Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

Commit a656094

Browse files
committed
🔒 Make eDEX single instance-locked
1 parent 651858f commit a656094

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/_boot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ process.on("uncaughtException", e => {
2020
signale.start(`Starting eDEX-UI v${app.getVersion()}`);
2121
signale.info(`With Node ${process.versions.node} and Electron ${process.versions.electron}`);
2222
signale.info(`Renderer is Chrome ${process.versions.chrome}`);
23+
24+
const gotLock = app.requestSingleInstanceLock();
25+
if (!gotLock) {
26+
signale.fatal("Error: Another instance of eDEX is already running. Cannot proceed.");
27+
app.exit(1);
28+
}
29+
2330
signale.time("Startup");
2431

2532
const electron = require("electron");

0 commit comments

Comments
 (0)