mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	catch mode signals to allow clean context flush on shutdown
(yes the name is intentionally ironic) Code pattern copied from https://nodejs.org/api/process.html#process_signal_events
This commit is contained in:
		
							
								
								
									
										10
									
								
								packages/node_modules/node-red/red.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								packages/node_modules/node-red/red.js
									
									
									
									
										vendored
									
									
								
							@@ -342,8 +342,14 @@ process.on('uncaughtException',function(err) {
 | 
			
		||||
    process.exit(1);
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
process.on('SIGINT', function () {
 | 
			
		||||
function brexit() {
 | 
			
		||||
    RED.stop().then(function() {
 | 
			
		||||
        process.exit();
 | 
			
		||||
    });
 | 
			
		||||
});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
process.on('SIGINT', brexit);
 | 
			
		||||
process.on('SIGTERM', brexit);
 | 
			
		||||
process.on('SIGHUP', brexit);
 | 
			
		||||
process.on('SIGUSR2', brexit);  // for nodemon restart
 | 
			
		||||
process.on('SIGBREAK', brexit); // for windows ctrl-break
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user