File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1114,11 +1114,26 @@ class Server {
1114
1114
if ( this . options . setupExitSignals ) {
1115
1115
const signals = [ "SIGINT" , "SIGTERM" ] ;
1116
1116
1117
+ let needForceShutdown = false ;
1118
+
1117
1119
signals . forEach ( ( signal ) => {
1118
1120
process . on ( signal , ( ) => {
1119
- this . stopCallback ( ( ) => {
1121
+ if ( needForceShutdown ) {
1120
1122
// eslint-disable-next-line no-process-exit
1121
1123
process . exit ( ) ;
1124
+ }
1125
+
1126
+ this . logger . info (
1127
+ "Gracefully shutting down. To force exit, press ^C again. Please wait..."
1128
+ ) ;
1129
+
1130
+ needForceShutdown = true ;
1131
+
1132
+ this . stopCallback ( ( ) => {
1133
+ this . compiler . close ( ( ) => {
1134
+ // eslint-disable-next-line no-process-exit
1135
+ process . exit ( ) ;
1136
+ } ) ;
1122
1137
} ) ;
1123
1138
} ) ;
1124
1139
} ) ;
You can’t perform that action at this time.
0 commit comments