File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1116,11 +1116,15 @@ class Server {
1116
1116
1117
1117
let needForceShutdown = false ;
1118
1118
1119
+ const exitProcess = ( ) => {
1120
+ // eslint-disable-next-line no-process-exit
1121
+ process . exit ( ) ;
1122
+ } ;
1123
+
1119
1124
signals . forEach ( ( signal ) => {
1120
1125
process . on ( signal , ( ) => {
1121
1126
if ( needForceShutdown ) {
1122
- // eslint-disable-next-line no-process-exit
1123
- process . exit ( ) ;
1127
+ exitProcess ( ) ;
1124
1128
}
1125
1129
1126
1130
this . logger . info (
@@ -1130,14 +1134,10 @@ class Server {
1130
1134
needForceShutdown = true ;
1131
1135
1132
1136
this . stopCallback ( ( ) => {
1133
- if ( this . compiler . close ) {
1134
- this . compiler . close ( ( ) => {
1135
- // eslint-disable-next-line no-process-exit
1136
- process . exit ( ) ;
1137
- } ) ;
1137
+ if ( typeof this . compiler . close === "function" ) {
1138
+ this . compiler . close ( exitProcess ) ;
1138
1139
} else {
1139
- // eslint-disable-next-line no-process-exit
1140
- process . exit ( ) ;
1140
+ exitProcess ( ) ;
1141
1141
}
1142
1142
} ) ;
1143
1143
} ) ;
You can’t perform that action at this time.
0 commit comments