File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
resources/js/electron-plugin Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { notifyLaravel } from "./server/utils.js";
16
16
import { resolve } from "path" ;
17
17
import { stopAllProcesses } from "./server/api/childProcess.js" ;
18
18
import ps from "ps-node" ;
19
+ import killSync from "kill-sync" ;
19
20
import electronUpdater from 'electron-updater' ;
20
21
const { autoUpdater } = electronUpdater ;
21
22
class NativePHP {
@@ -173,6 +174,7 @@ class NativePHP {
173
174
. filter ( ( p ) => p !== undefined )
174
175
. forEach ( ( process ) => {
175
176
try {
177
+ killSync ( process . pid , 'SIGTERM' , true ) ;
176
178
ps . kill ( process . pid ) ;
177
179
}
178
180
catch ( err ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { notifyLaravel } from "./server/utils.js";
14
14
import { resolve } from "path" ;
15
15
import { stopAllProcesses } from "./server/api/childProcess.js" ;
16
16
import ps from "ps-node" ;
17
+ import killSync from "kill-sync" ;
17
18
18
19
// Workaround for CommonJS module
19
20
import electronUpdater from 'electron-updater' ;
@@ -241,7 +242,9 @@ class NativePHP {
241
242
. filter ( ( p ) => p !== undefined )
242
243
. forEach ( ( process ) => {
243
244
try {
244
- ps . kill ( process . pid ) ;
245
+ // @ts -ignore
246
+ killSync ( process . pid , 'SIGTERM' , true ) ; // Kill tree
247
+ ps . kill ( process . pid ) ; // Sometimes does not kill the subprocess of php server
245
248
} catch ( err ) {
246
249
console . error ( err ) ;
247
250
}
You can’t perform that action at this time.
0 commit comments