From 3275731c1aaf3de73b2ab557b70f3c123176a9fc Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 24 May 2018 14:41:23 +0200 Subject: [PATCH] User can stop bot --- Run.js | 1 + StatusReport.js | 4 ++-- TradingBotProcessMainLoop.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Run.js b/Run.js index b6a254f21..758f6ae08 100644 --- a/Run.js +++ b/Run.js @@ -1,6 +1,7 @@  global.CURRENT_ENVIRONMENT = "Develop"; global.CURRENT_LOCATION = "Cloud"; +global.SHALL_BOT_STOP = false; process.on('uncaughtException', function (err) { console.log('[INFO] Run -> uncaughtException -> err.message = ' + err.message); diff --git a/StatusReport.js b/StatusReport.js index b3d2c2451..6cd0d8830 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -131,7 +131,7 @@ return; } - if (FULL_LOG === true) { + if (LOG_FILE_CONTENT === true) { logger.write("[INFO] initialize -> load -> onFileReceived -> Content received = " + text); } @@ -219,7 +219,7 @@ return; } - if (FULL_LOG === true) { + if (LOG_FILE_CONTENT === true) { logger.write("[INFO] save -> onFolderCreated -> onFileCreated -> Content written = " + fileContent); } diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index 70c918890..a2d964a0c 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -777,7 +777,7 @@ let configRead = JSON.parse(text); - if (configRead.stopGracefully === false) { + if (configRead.stopGracefully === false && global.SHALL_BOT_STOP === false) { continueCallBack(); } else { stopCallBack();