File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -245,25 +245,28 @@ function mount_dav(server) {
245
245
winston . info ( 'webdav filesystem mounted' ) ;
246
246
}
247
247
248
- process . on ( 'SIGINT' , function ( ) {
249
- winston . info ( "\nShutting down from SIGINT" ) ;
250
- console . log ( terminals ) ;
251
-
248
+ function cleanup ( ) {
249
+ winston . info ( "process and worker cleanup" ) ;
252
250
Object . keys ( terminals ) . forEach ( function ( pid ) {
253
251
var term = terminals [ pid ] ;
254
252
console . log ( 'Closed terminal ' + term . pid ) ;
255
253
term . kill ( ) ;
256
254
} ) ;
257
255
258
- // some other closing procedures go here
259
256
debug_helper . kill_debug ( false , function ( ) {
260
257
//no need to wait for this
261
258
} ) ;
259
+ }
260
+
261
+ process . on ( 'SIGINT' , function ( ) {
262
+ winston . info ( "Shutting down from SIGINT" ) ;
263
+ cleanup ( ) ;
262
264
process . exit ( ) ;
263
265
} ) ;
264
266
265
- // process.on('uncaughtException', function(err) {
266
- // debug_helper.kill_debug(false, function() {
267
- // //no need to wait for this
268
- // });
269
- // });
267
+ process . on ( 'uncaughtException' , function ( err ) {
268
+ winston . error ( "Shutting down from uncaughtException" ) ;
269
+ winston . error ( err . stack ) ;
270
+ cleanup ( ) ;
271
+ process . exit ( ) ;
272
+ } ) ;
You can’t perform that action at this time.
0 commit comments