File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ async function killPort(port: number): Promise<void> {
3939 for ( const pid of pids ) {
4040 process . kill ( Number ( pid ) , 'SIGTERM' ) ;
4141 }
42- await new Promise ( ( r ) => setTimeout ( r , 500 ) ) ;
42+ // Wait for graceful shutdown, then SIGKILL survivors
43+ await new Promise ( ( r ) => setTimeout ( r , 1000 ) ) ;
44+ for ( const pid of pids ) {
45+ try { process . kill ( Number ( pid ) , 'SIGKILL' ) ; } catch { /* already dead */ }
46+ }
4347 } catch {
4448 // No process on port — nothing to kill
4549 }
@@ -69,7 +73,11 @@ async function killByName(): Promise<void> {
6973 for ( const pid of toKill ) {
7074 try { process . kill ( pid , 'SIGTERM' ) ; } catch { /* already dead */ }
7175 }
72- await new Promise ( ( r ) => setTimeout ( r , 500 ) ) ;
76+ // Wait for graceful shutdown, then SIGKILL survivors
77+ await new Promise ( ( r ) => setTimeout ( r , 1000 ) ) ;
78+ for ( const pid of toKill ) {
79+ try { process . kill ( pid , 'SIGKILL' ) ; } catch { /* already dead */ }
80+ }
7381 } catch {
7482 // pgrep returns exit code 1 when no processes match — expected
7583 }
You can’t perform that action at this time.
0 commit comments