From e6369820a9665117554d081a37612ae609cd167a Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 25 Jan 2018 14:04:38 +0000 Subject: [PATCH] SIGINT handler should wait for stop to complete before exit --- red.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/red.js b/red.js index a4a227738..83589edd5 100755 --- a/red.js +++ b/red.js @@ -333,8 +333,7 @@ process.on('uncaughtException',function(err) { }); process.on('SIGINT', function () { - RED.stop(); - // TODO: need to allow nodes to close asynchronously before terminating the - // process - ie, promises - process.exit(); + RED.stop().then(function() { + process.exit(); + }); });