File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1634,12 +1634,17 @@ const parentSigtermCallback: SigtermCallback = async (signal, exitCode) => {
16341634 await Promise . all ( [ ...sigtermCallbacks ] . map ( ( cb ) => cb ( signal , exitCode ) ) )
16351635}
16361636
1637+ const drain = ( ) => { }
1638+
16371639export const setupSIGTERMListener = (
16381640 callback : ( signal ?: 'SIGTERM' , exitCode ?: number ) => Promise < void > ,
16391641) : void => {
16401642 if ( sigtermCallbacks . size === 0 ) {
16411643 process . once ( 'SIGTERM' , parentSigtermCallback )
16421644 if ( process . env . CI !== 'true' ) {
1645+ if ( ! process . stdin . isTTY ) {
1646+ process . stdin . on ( "data" , drain )
1647+ }
16431648 process . stdin . on ( 'end' , parentSigtermCallback )
16441649 }
16451650 }
@@ -1653,6 +1658,7 @@ export const teardownSIGTERMListener = (
16531658 if ( sigtermCallbacks . size === 0 ) {
16541659 process . off ( 'SIGTERM' , parentSigtermCallback )
16551660 if ( process . env . CI !== 'true' ) {
1661+ process . stdin . off ( "data" , drain )
16561662 process . stdin . off ( 'end' , parentSigtermCallback )
16571663 }
16581664 }
You can’t perform that action at this time.
0 commit comments