Bug fixes that improve resilience when running live

This commit is contained in:
Luis Fernando Molina committed 2020-04-27 10:13:52 +02:00
1 parent 7cd9727bab
commit ec6e9fc907
20 files changed
+288 -153

No files matched your search

+7 -1
View File
@@ -17,7 +17,8 @@ exports.newDebugLog = function newDebugLog() {
write: write,
newInternalLoop: newInternalLoop,
persist: persist, // This method is executed at the end of each Main Loop.
initialize: initialize
initialize: initialize,
finalize: finalize
};
let accumulatedLog = "[";
@@ -37,6 +38,10 @@ exports.newDebugLog = function newDebugLog() {
}
}
function finalize() {
persist()
}
function newInternalLoop(pBot, pProcess, date, percentage) {
if (percentage === undefined) {
percentage = ""
@@ -64,6 +69,7 @@ exports.newDebugLog = function newDebugLog() {
/* Here we actually write the content of the in-memory log to a file */
try {
if (accumulatedLog === "[") {return} // nothing to persist at the moment.
internalLoopCounter++;