Loophealth check only if there is a waitime set

This commit is contained in:
Luis Fernando Molina committed 2019-09-19 15:23:02 +02:00
1 parent fca8c91f9b
commit 8a5edf831c
3 files changed
+18 -6

No files matched your search

+6 -2
View File
@@ -578,14 +578,18 @@
case 'Normal': {
if (bot.runAtFixedInterval === true) {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> loopControl -> Fixed Interval Normal exit point reached."); }
checkLoopHealthHandle = setTimeout(checkLoopHealth, bot.fixedInterval * 5, bot.loopCounter);
if (processConfig.deadWaitTime > 0) {
checkLoopHealthHandle = setTimeout(checkLoopHealth, processConfig.deadWaitTime, bot.loopCounter);
}
if(global.WRITE_LOGS_TO_FILES === 'true'){
logger.persist();
}
return;
} else {
if (FULL_LOG === true) { logger.write(MODULE_NAME, "[INFO] run -> loop -> loopControl -> Restarting Loop in " + (processConfig.normalWaitTime / 1000) + " seconds."); }
checkLoopHealthHandle = setTimeout(checkLoopHealth, processConfig.deadWaitTime * 5, bot.loopCounter);
if (processConfig.deadWaitTime > 0) {
checkLoopHealthHandle = setTimeout(checkLoopHealth, processConfig.deadWaitTime, bot.loopCounter);
}
nextLoopTimeoutHandle = setTimeout(loop, processConfig.normalWaitTime);
if(global.WRITE_LOGS_TO_FILES === 'true'){
logger.persist();