1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-21 03:45:52 +01:00
upscayl/electron/commands/stop.ts

17 lines
456 B
TypeScript
Raw Normal View History

2023-09-10 19:42:18 +02:00
import { getMainWindow } from "../main-window";
import { childProcesses, setStopped } from "../utils/config-variables";
2023-09-10 11:14:04 +02:00
import logit from "../utils/logit";
const stop = async (event, payload) => {
2023-09-10 19:54:08 +02:00
const mainWindow = getMainWindow();
2023-09-10 19:42:18 +02:00
setStopped(true);
2023-09-10 11:14:04 +02:00
mainWindow && mainWindow.setProgressBar(-1);
2023-09-10 19:42:18 +02:00
childProcesses.forEach((child) => {
2023-09-10 11:14:04 +02:00
logit("🛑 Stopping Upscaling Process", child.process.pid);
child.kill();
});
};
export default stop;