Skip to content

Commit 8eef63c

Browse files
gwleuverinkgithub-actions[bot]
authored andcommitted
Build plugin
1 parent 79d26e4 commit 8eef63c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

resources/js/electron-plugin/dist/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { app, session, powerMonitor } from "electron";
1111
import { initialize } from "@electron/remote/main/index.js";
1212
import state from "./server/state.js";
1313
import { electronApp, optimizer } from "@electron-toolkit/utils";
14-
import { retrieveNativePHPConfig, retrievePhpIniSettings, runScheduler, startAPI, startPhpApp, } from "./server/index.js";
14+
import { retrieveNativePHPConfig, retrievePhpIniSettings, runScheduler, killScheduler, startAPI, startPhpApp, } from "./server/index.js";
1515
import { notifyLaravel } from "./server/utils.js";
1616
import { resolve } from "path";
1717
import { stopAllProcesses } from "./server/api/childProcess.js";
@@ -22,8 +22,8 @@ const { autoUpdater } = electronUpdater;
2222
class NativePHP {
2323
constructor() {
2424
this.processes = [];
25-
this.schedulerInterval = undefined;
2625
this.mainWindow = null;
26+
this.schedulerInterval = undefined;
2727
}
2828
bootstrap(app, icon, phpBinary, cert) {
2929
initialize();
@@ -192,6 +192,7 @@ class NativePHP {
192192
clearInterval(this.schedulerInterval);
193193
this.schedulerInterval = null;
194194
}
195+
killScheduler();
195196
}
196197
startScheduler() {
197198
const now = new Date();
@@ -206,6 +207,7 @@ class NativePHP {
206207
}, delay);
207208
}
208209
killChildProcesses() {
210+
this.stopScheduler();
209211
this.processes
210212
.filter((p) => p !== undefined)
211213
.forEach((process) => {

resources/js/electron-plugin/dist/server/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import startAPIServer from "./api.js";
1111
import { retrieveNativePHPConfig, retrievePhpIniSettings, serveApp, startScheduler, } from "./php.js";
1212
import { appendCookie } from "./utils.js";
1313
import state from "./state.js";
14+
let schedulerProcess = null;
1415
export function startPhpApp() {
1516
return __awaiter(this, void 0, void 0, function* () {
1617
const result = yield serveApp(state.randomSecret, state.electronApiPort, state.phpIni);
@@ -20,7 +21,14 @@ export function startPhpApp() {
2021
});
2122
}
2223
export function runScheduler() {
23-
startScheduler(state.randomSecret, state.electronApiPort, state.phpIni);
24+
killScheduler();
25+
schedulerProcess = startScheduler(state.randomSecret, state.electronApiPort, state.phpIni);
26+
}
27+
export function killScheduler() {
28+
if (schedulerProcess && !schedulerProcess.killed) {
29+
schedulerProcess.kill();
30+
schedulerProcess = null;
31+
}
2432
}
2533
export function startAPI() {
2634
return startAPIServer(state.randomSecret);

0 commit comments

Comments
 (0)