TidGi-Desktop/src/helpers/singleInstance.ts
2023-05-19 11:22:38 +08:00

12 lines
334 B
TypeScript

import { logger } from '@services/libs/log';
import { app } from 'electron';
const gotTheLock = app.requestSingleInstanceLock();
logger.info('App booting');
if (!gotTheLock) {
logger.info('Quitting dut to we only allow one instance to run.');
console.info('Quitting dut to we only allow one instance to run.');
app.quit();
}