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";
1616import { resolve } from "path" ;
1717import { stopAllProcesses } from "./server/api/childProcess.js" ;
1818import ps from "ps-node" ;
19+ import killSync from "kill-sync" ;
1920import electronUpdater from 'electron-updater' ;
2021const { autoUpdater } = electronUpdater ;
2122class NativePHP {
@@ -173,6 +174,7 @@ class NativePHP {
173174 . filter ( ( p ) => p !== undefined )
174175 . forEach ( ( process ) => {
175176 try {
177+ killSync ( process . pid , 'SIGTERM' , true ) ;
176178 ps . kill ( process . pid ) ;
177179 }
178180 catch ( err ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { notifyLaravel } from "./server/utils.js";
1414import { resolve } from "path" ;
1515import { stopAllProcesses } from "./server/api/childProcess.js" ;
1616import ps from "ps-node" ;
17+ import killSync from "kill-sync" ;
1718
1819// Workaround for CommonJS module
1920import electronUpdater from 'electron-updater' ;
@@ -241,7 +242,9 @@ class NativePHP {
241242 . filter ( ( p ) => p !== undefined )
242243 . forEach ( ( process ) => {
243244 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
245248 } catch ( err ) {
246249 console . error ( err ) ;
247250 }
You can’t perform that action at this time.
0 commit comments