From b07deb537ee3513b16bd3a14115c469449d38ba9 Mon Sep 17 00:00:00 2001 From: Nuno Guedelha Date: Wed, 3 Nov 2021 23:07:46 +0100 Subject: [PATCH] Workaround: calling 'process.exit()' after execution of 'Subset C' (closure last step). - Refer to #61. For some reason, there are pending events in the Node Event Loop preventing the process to exit on its own. --- iCubTelemVizServer/terminationHandler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iCubTelemVizServer/terminationHandler.js b/iCubTelemVizServer/terminationHandler.js index 84a95fc..ba32b83 100644 --- a/iCubTelemVizServer/terminationHandler.js +++ b/iCubTelemVizServer/terminationHandler.js @@ -20,7 +20,10 @@ TerminationHandler.prototype.run = function(signal) { this.runSubsetB.bind(this)).then( this.runSubsetC.bind(this)); Promise.all([subsetCpromise,subsetApromise.closeServers]).then( - function(values) { values.forEach((v) => console.log(v)); } + function(values) { + values.forEach((v) => console.log(v)); + process.exit(); + } ).catch(console.error); }