From 5732f0dd3ab32e8fdc0e136c4977f9398c894b40 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 27 Nov 2020 20:23:49 +0100 Subject: [PATCH] Cleaning --- Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js | 5 +++-- TaskServer/Globals.js | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js b/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js index 9cc9f79d2..ee4887ceb 100644 --- a/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js +++ b/Projects/Superalgos/TS/Function-Libraries/NodeJSFunctions.js @@ -4,6 +4,7 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () { exitProcess: exitProcess } + let isNodeJsProcessShuttingDown = false return thisObject function exitProcess() { @@ -12,8 +13,8 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () { TS.projects.superalgos.functionLibraries.taskFunctions.taskError(undefined, "An unexpected error caused the Task to stop.") } - if (global.SHUTTING_DOWN_PROCESS === true) { return } - global.SHUTTING_DOWN_PROCESS = true + if (isNodeJsProcessShuttingDown=== true) { return } + isNodeJsProcessShuttingDown = true /* Signal that all sessions are stopping. */ TS.projects.superalgos.functionLibraries.sessionFunctions.finalizeSessions() diff --git a/TaskServer/Globals.js b/TaskServer/Globals.js index 6fe63da21..b00c98769 100644 --- a/TaskServer/Globals.js +++ b/TaskServer/Globals.js @@ -26,7 +26,6 @@ exports.newGlobals = function () { } } - global.SHUTTING_DOWN_PROCESS = false /* We need to count how many process instances we deployd and how many of them have already finished their job, either because they just finished or because there was a request to stop the proceses. In this way, once we reach the