()
| 239 | |
| 240 | // Force kill the backend process |
| 241 | function forceKillBackendProcess() { |
| 242 | if (backendProcess) { |
| 243 | try { |
| 244 | if (process.platform !== 'win32') { |
| 245 | // Use SIGKILL to force kill the process group |
| 246 | logToBackendFile(`Force killing process group -${backendProcess.pid} with SIGKILL`) |
| 247 | process.kill(-backendProcess.pid, 'SIGKILL') |
| 248 | } else { |
| 249 | // Force terminate on Windows systems |
| 250 | logToBackendFile(`Force killing process ${backendProcess.pid}`) |
| 251 | backendProcess.kill('SIGKILL') |
| 252 | } |
| 253 | } catch (killError) { |
| 254 | logToBackendFile(`Error force killing process: ${killError}`) |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | // Kill process by port |
| 260 | function killProcessByPort(port: number) { |
no test coverage detected