From 031add278f67e71ac918a54b58399ec92619dcc3 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 30 May 2018 11:26:01 +0200 Subject: [PATCH] Support to EXECUTION AT, reading bots from members or devTeams --- Assistant.js | 27 +++++++++++------ BlobStorage.js | 10 +++++-- CloudRequire.js | 34 +++++++++++++++++++-- Context.js | 8 ++--- DebugLog.js | 4 +-- ExtractionBotProcessMainLoop.js | 8 ++--- IndicatorBotProcessMainLoop.js | 8 ++--- Root.js | 53 ++++++++++++++++++++++++++------- Run.js | 6 ++-- StatusReport.js | 2 +- TradingBotProcessMainLoop.js | 26 ++++++++-------- 11 files changed, 131 insertions(+), 55 deletions(-) diff --git a/Assistant.js b/Assistant.js index 7252104e4..98b9b53af 100644 --- a/Assistant.js +++ b/Assistant.js @@ -57,11 +57,20 @@ switch (bot.runMode) { - case 'Live': { getMarketRateFromExchange();} + case 'Live': { + getMarketRateFromExchange(); + break; + } - case 'Backtest': { getMarketRateFromIndicator();} + case 'Backtest': { + getMarketRateFromIndicator(); + break; + } - case 'Competition': { getMarketRateFromExchange(); } + case 'Competition': { + getMarketRateFromExchange(); + break; + } default: { logger.write("[ERROR] initialize -> Unexpected bot.runMode."); @@ -221,7 +230,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] initialize -> validateExchangeSyncronicity -> onDone -> Execution finished well. :-)"); + logger.write("[INFO] initialize -> validateExchangeSyncronicity -> onDone -> Execution finished well."); calculateProfits(); return; } @@ -360,7 +369,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { // Everything went well, we have the information requested. - logger.write("[INFO] getPositionsAtExchange -> onResponse -> Execution finished well. :-)"); + logger.write("[INFO] getPositionsAtExchange -> onResponse -> Execution finished well."); exchangePositions = pExchangePositions; ordersExecutionCheck(callBack); return; @@ -576,7 +585,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { // Everything went well, we have the information requested. - logger.write("[INFO] ordersExecutionCheck -> loopBody -> getPositionTradesAtExchange -> onResponse -> Execution finished well. :-)"); + logger.write("[INFO] ordersExecutionCheck -> loopBody -> getPositionTradesAtExchange -> onResponse -> Execution finished well."); innerCallBack(pTrades); } break; @@ -609,7 +618,7 @@ try { if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write("[INFO] ordersExecutionCheck -> loopBody -> confirmOrderWasExecuted -> Entering function."); } - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write("[INFO] ordersExecutionCheck -> loopBody -> confirmOrderWasExecuted -> pTrades = " + JSON.stringify(pTrades)); } + if (global.LOG_CONTROL[MODULE_NAME].logContent === true) { logger.write("[INFO] ordersExecutionCheck -> loopBody -> confirmOrderWasExecuted -> pTrades = " + JSON.stringify(pTrades)); } /* @@ -982,7 +991,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { // Everything went well, we have the information requested. - logger.write("[INFO] putPosition -> onResponse -> Execution finished well. :-)"); + logger.write("[INFO] putPosition -> onResponse -> Execution finished well."); let position = { id: pPositionId, @@ -1097,7 +1106,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { // Everything went well, we have the information requested. - logger.write("[INFO] movePosition -> onResponse -> Execution finished well. :-)"); + logger.write("[INFO] movePosition -> onResponse -> Execution finished well."); let newPosition = { id: pPositionId, diff --git a/BlobStorage.js b/BlobStorage.js index d9d845cd2..9b91113d9 100644 --- a/BlobStorage.js +++ b/BlobStorage.js @@ -247,7 +247,10 @@ exports.newBlobStorage = function newBlobStorage(BOT) { message: "File does not exist." }; - logger.write("[ERROR] getTextFile -> onFileReceived -> Custom Response -> message = " + customErr.message); + logger.write("[WARN] getTextFile -> onFileReceived -> Custom Response -> message = " + customErr.message); + logger.write("[WARN] getTextFile -> containerName = " + containerName); + logger.write("[WARN] getTextFile -> pFolderPath = " + pFolderPath); + logger.write("[WARN] getTextFile -> pFileName = " + pFileName); callBackFunction(customErr); return; @@ -263,7 +266,10 @@ exports.newBlobStorage = function newBlobStorage(BOT) { message: "Folder does not exist." }; - logger.write("[ERROR] getTextFile -> onFileReceived -> Custom Response -> message = " + customErr.message); + logger.write("[WARN] getTextFile -> onFileReceived -> Custom Response -> message = " + customErr.message); + logger.write("[WARN] getTextFile -> containerName = " + containerName); + logger.write("[WARN] getTextFile -> pFolderPath = " + pFolderPath); + logger.write("[WARN] getTextFile -> pFileName = " + pFileName); callBackFunction(customErr); return; diff --git a/CloudRequire.js b/CloudRequire.js index 361ce8cfb..20c4e72a0 100644 --- a/CloudRequire.js +++ b/CloudRequire.js @@ -25,7 +25,22 @@ if (FULL_LOG === true) { logger.write("[INFO] downloadBot -> Entering function."); } - let filePath = global.USER_DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + bot.repo + "/" + pProcessConfig.name; + let filePath; + + switch (global.CURRENT_EXECUTION_AT) { + case "Cloud": { + filePath = global.DEV_TEAM + "/" + "bots" + "/" + bot.repo + "/" + pProcessConfig.name; // DevTeams bots only are run at the cloud. + break; + } + case "Browser": { + filePath = global.DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + bot.repo + "/" + pProcessConfig.name; // DevTeam Members bots only are run at the browser. + break; + } + default: { + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> CURRENT_EXECUTION_AT must be either 'Cloud' or 'Browser' "); + } + } + let fileName = "User.Bot.js"; pCloudStorage.getTextFile(filePath, fileName, onFileReceived); @@ -65,7 +80,22 @@ if (FULL_LOG === true) { logger.write("[INFO] downloadCommons -> Entering function."); } - let filePath = bot.devTeam + "/" + bot.repo; + let filePath; + + switch (global.CURRENT_EXECUTION_AT) { + case "Cloud": { + filePath = global.DEV_TEAM + "/" + "bots" + "/" + bot.repo; // DevTeams bots only are run at the cloud. + break; + } + case "Browser": { + filePath = global.DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + bot.repo; // DevTeam Members bots only are run at the browser. + break; + } + default: { + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> CURRENT_EXECUTION_AT must be either 'Cloud' or 'Browser' "); + } + } + let fileName = "Commons.js"; pCloudStorage.getTextFile(filePath, fileName, onFileReceived); diff --git a/Context.js b/Context.js index 315985a51..1c7a35a24 100644 --- a/Context.js +++ b/Context.js @@ -130,7 +130,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] initialize -> onDone -> Execution finished well. :-)"); + logger.write("[INFO] initialize -> onDone -> Execution finished well."); bot.hasTheBotJustStarted = false; @@ -326,7 +326,7 @@ return; } - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { + if (global.LOG_CONTROL[MODULE_NAME].logContent === true) { logger.write("[INFO] initialize -> getExecutionContext -> onFileReceived -> Content received = " + text); } @@ -497,7 +497,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] saveThemAll -> onDone -> Execution finished well. :-)"); + logger.write("[INFO] saveThemAll -> onDone -> Execution finished well."); callBackFunction(global.DEFAULT_OK_RESPONSE); return; } @@ -563,7 +563,7 @@ return; } - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { + if (global.LOG_CONTROL[MODULE_NAME].logContent === true) { logger.write("[INFO] saveThemAll -> writeExecutionContext -> onFolderCreated -> onFileCreated -> Content written = " + fileContent); } diff --git a/DebugLog.js b/DebugLog.js index fd97e49f5..ac8da183f 100644 --- a/DebugLog.js +++ b/DebugLog.js @@ -176,11 +176,11 @@ function write(Message) { - console.log("AACloud" + spacePad(thisObject.fileName, 40) + " : " + Message); + console.log("AACloud" + spacePad(thisObject.fileName, 50) + " : " + Message); if (thisObject.bot === undefined) { return;} - if (firstCall === true && global.CURRENT_LOCATION === "Cloud") { createFolders(); } + if (firstCall === true && global.CURRENT_EXECUTION_AT === "Cloud") { createFolders(); } if (thisObject.bot.loopCounter !== loopCounter) { diff --git a/ExtractionBotProcessMainLoop.js b/ExtractionBotProcessMainLoop.js index 4ef08db9c..f811f1c3e 100644 --- a/ExtractionBotProcessMainLoop.js +++ b/ExtractionBotProcessMainLoop.js @@ -162,7 +162,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well."); initializeUserBot(); return; } @@ -224,7 +224,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized > Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized > Execution finished well."); startUserBot(); return; } @@ -284,7 +284,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> startUserBot -> onFinished > Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> startUserBot -> onFinished > Execution finished well."); nextWaitTime = 'Normal'; loopControl(nextWaitTime); return; @@ -401,7 +401,7 @@ if (bot.runAtFixedInterval === true) { intervalHandle.clearInterval();} - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time! :-)"); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time!"); } bot.eventHandler.raiseEvent("Loop Finished"); clearInterval(intervalHandle); callBackFunction(global.DEFAULT_OK_RESPONSE); diff --git a/IndicatorBotProcessMainLoop.js b/IndicatorBotProcessMainLoop.js index 196854fce..d75b53f94 100644 --- a/IndicatorBotProcessMainLoop.js +++ b/IndicatorBotProcessMainLoop.js @@ -152,7 +152,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well."); initializeUserBot(); return; } @@ -211,7 +211,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized -> Execution finished well."); startUserBot(); return; } @@ -267,7 +267,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> startUserBot -> onFinished -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> startUserBot -> onFinished -> Execution finished well."); nextWaitTime = 'Normal'; loopControl(nextWaitTime); return; @@ -372,7 +372,7 @@ function onStop() { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time! :-)"); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time!"); } bot.eventHandler.raiseEvent("Loop Finished"); callBackFunction(global.DEFAULT_OK_RESPONSE); diff --git a/Root.js b/Root.js index 0aa5d9556..dcd371110 100644 --- a/Root.js +++ b/Root.js @@ -127,7 +127,7 @@ exports.newRoot = function newRoot() { let cloudStorage; - let logDisplace = "AACloud" + " "; + let logDisplace = "AACloud" + " "; let UI_COMMANDS; return thisObject; @@ -148,7 +148,22 @@ exports.newRoot = function newRoot() { if (err.result === global.DEFAULT_OK_RESPONSE.result) { - let filePath = global.USER_DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + "AACloud"; + let filePath; + + switch (global.CURRENT_EXECUTION_AT) { + case "Cloud": { + filePath = global.DEV_TEAM + "/" + "AACloud"; // DevTeams bots only are run at the cloud. + break; + } + case "Browser": { + filePath = global.DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + "AACloud"; // DevTeam Members bots only are run at the browser. + break; + } + default: { + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> CURRENT_EXECUTION_AT must be either 'Cloud' or 'Browser' "); + } + } + let fileName = "this.config.json"; cloudStorage.getTextFile(filePath, fileName, onFileReceived); @@ -236,7 +251,22 @@ exports.newRoot = function newRoot() { if (err.result === global.DEFAULT_OK_RESPONSE.result) { - let filePath = listItem.devTeam + "/" + listItem.repo; + let filePath; + + switch (global.CURRENT_EXECUTION_AT) { + case "Cloud": { + filePath = global.DEV_TEAM + "/" + "bots" + "/" + listItem.repo; // DevTeams bots only are run at the cloud. + break; + } + case "Browser": { + filePath = global.DEV_TEAM + "/" + "members" + "/" + global.USER_LOGGED_IN + "/" + listItem.repo; // DevTeam Members bots only are run at the browser. + break; + } + default: { + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> CURRENT_EXECUTION_AT must be either 'Cloud' or 'Browser' "); + } + } + let fileName = "this.bot.config.json"; cloudStorage.getTextFile(filePath, fileName, onFileReceived); @@ -244,7 +274,10 @@ exports.newRoot = function newRoot() { function onFileReceived(err, text) { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { - console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> onFileReceived -> err = " + err.message); + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> onFileReceived -> err = " + err.message); + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> onFileReceived -> filePath = " + filePath); + console.log(logDisplace + "Root : [ERROR] start -> getBotConfig -> onInizialized -> onFileReceived -> fileName = " + fileName); + return; } @@ -563,9 +596,9 @@ exports.newRoot = function newRoot() { if (err.result === global.DEFAULT_OK_RESPONSE.result) { - logger.write("[INFO] start -> findProcess -> runExtractionBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully. :-)"); + logger.write("[INFO] start -> findProcess -> runExtractionBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully."); logger.write("[INFO] start -> findProcess -> runExtractionBot -> onInitializeReady -> whenStartFinishes -> Bot Id = " + botId); - console.log(botId + " Bot execution finished sucessfully. :-)"); + console.log(botId + " Bot execution finished sucessfully."); } else { @@ -615,9 +648,9 @@ exports.newRoot = function newRoot() { if (err.result === global.DEFAULT_OK_RESPONSE.result) { - logger.write("[INFO] start -> findProcess -> runIndicatorBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully. :-)"); + logger.write("[INFO] start -> findProcess -> runIndicatorBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully."); logger.write("[INFO] start -> findProcess -> runIndicatorBot -> onInitializeReady -> whenStartFinishes -> Bot Id = " + botId); - console.log(botId + " Bot execution finished sucessfully. :-)"); + console.log(botId + " Bot execution finished sucessfully."); } else { @@ -662,9 +695,9 @@ exports.newRoot = function newRoot() { if (err.result === global.DEFAULT_OK_RESPONSE.result) { - logger.write("[INFO] start -> findProcess -> runTradingBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully. :-)"); + logger.write("[INFO] start -> findProcess -> runTradingBot -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully."); logger.write("[INFO] start -> findProcess -> runTradingBot -> onInitializeReady -> whenStartFinishes -> Bot Id = " + botId); - console.log(botId + " Bot execution finished sucessfully. :-)"); + console.log(botId + " Bot execution finished sucessfully."); } else { diff --git a/Run.js b/Run.js index d0d489e8d..aeefab13b 100644 --- a/Run.js +++ b/Run.js @@ -1,23 +1,21 @@  global.CURRENT_ENVIRONMENT = "Develop"; -global.CURRENT_LOCATION = "Cloud"; +global.CURRENT_EXECUTION_AT = "Cloud"; global.SHALL_BOT_STOP = false; global.USER_LOGGED_IN = "ciencias"; -global.USER_DEV_TEAM = "AAMasters"; +global.DEV_TEAM = "AAMasters"; process.on('uncaughtException', function (err) { console.log('[INFO] Run -> uncaughtException -> err.message = ' + err.message); return; }); - process.on('unhandledRejection', (reason, p) => { console.log('[INFO] Run -> unhandledRejection -> reason = ' + reason); console.log('[INFO] Run -> unhandledRejection -> p = ' + JSON.stringify(p)); return; }); - process.on('exit', function (code) { try { console.log('[INFO] Run -> process.on.exit -> About to exit -> code = ' + code); diff --git a/StatusReport.js b/StatusReport.js index 70ad6076e..786d3636b 100644 --- a/StatusReport.js +++ b/StatusReport.js @@ -464,7 +464,7 @@ /* We arrived to the point where we have checked all the status reports of every month and they are all complete. */ - if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write("[INFO] verifyMarketComplete -> loop -> Verification Finished. Success. :-)"); } + if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write("[INFO] verifyMarketComplete -> loop -> Verification Finished. Success."); } callBackFunction(global.DEFAULT_OK_RESPONSE); return; diff --git a/TradingBotProcessMainLoop.js b/TradingBotProcessMainLoop.js index e271b7b58..d6a8bb631 100644 --- a/TradingBotProcessMainLoop.js +++ b/TradingBotProcessMainLoop.js @@ -295,7 +295,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeStatusDependencies -> onInizialized -> Execution finished well."); initializeDataDependencies(); return; } @@ -353,7 +353,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeDataDependencies -> onInizialized -> Execution finished well."); initializeContext(); return; } @@ -410,7 +410,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeContext -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeContext -> onInizialized -> Execution finished well."); initializeExchangeAPI(); return; } @@ -468,7 +468,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeExchangeAPI -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeExchangeAPI -> onInizialized -> Execution finished well."); initializeAssistant(); return; } @@ -525,7 +525,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeAssistant -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeAssistant -> onInizialized -> Execution finished well."); initializeUserBot(); return; } @@ -583,7 +583,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> initializeUserBot -> onInizialized -> Execution finished well."); startUserBot(); return; } @@ -639,7 +639,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> startUserBot -> onFinished -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> startUserBot -> onFinished -> Execution finished well."); saveContext(); return; } @@ -695,7 +695,7 @@ switch (err.result) { case global.DEFAULT_OK_RESPONSE.result: { - logger.write("[INFO] run -> loop -> saveContext -> onFinished -> Execution finished well. :-)"); + logger.write("[INFO] run -> loop -> saveContext -> onFinished -> Execution finished well."); nextWaitTime = 'Normal'; loopControl(nextWaitTime); return; @@ -753,7 +753,7 @@ function onStop() { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time! :-)"); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Stopping the Loop Gracefully. See you next time!"); } bot.eventHandler.raiseEvent("Loop Finished"); callBackFunction(global.DEFAULT_OK_RESPONSE); return; @@ -766,25 +766,25 @@ switch (nextWaitTime) { case 'Normal': { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.normalWaitTime / 1000) + " seconds."); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Normal -> Restarting Loop in " + (processConfig.normalWaitTime / 1000) + " seconds."); } bot.eventHandler.raiseEvent("Loop Finished"); setTimeout(loop, processConfig.normalWaitTime); } break; case 'Retry': { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.retryWaitTime / 1000) + " seconds."); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Retry -> Restarting Loop in " + (processConfig.retryWaitTime / 1000) + " seconds."); } bot.eventHandler.raiseEvent("Loop Finished"); setTimeout(loop, processConfig.retryWaitTime); } break; case 'Sleep': { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.sleepWaitTime / 60000) + " minutes."); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Sleep -> Restarting Loop in " + (processConfig.sleepWaitTime / 60000) + " minutes."); } bot.eventHandler.raiseEvent("Loop Finished"); setTimeout(loop, processConfig.sleepWaitTime); } break; case 'Coma': { - if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Restarting Loop in " + (processConfig.comaWaitTime / 3600000) + " hours."); } + if (FULL_LOG === true) { logger.write("[INFO] run -> loopControl -> Coma -> Restarting Loop in " + (processConfig.comaWaitTime / 3600000) + " hours."); } bot.eventHandler.raiseEvent("Loop Finished"); setTimeout(loop, processConfig.comaWaitTime); }