moved to logger variables

This commit is contained in:
Luis Fernando Molina committed 2020-12-01 15:43:39 +01:00
1 parent 2e6c6f9644
commit 53006f707b
4 files changed
+7 -7

No files matched your search

+4 -4
View File
@@ -115,11 +115,11 @@ exports.newDebugLog = function (processIndex) {
/* This is the implementation of the mechanism to auto-mantain logs. */
if (contentToPersist.indexOf('[ERROR]') < 0 && contentToPersist.indexOf('[PERSIST]') < 0 && contentToPersist.indexOf('[IMPORTANT]') < 0) {
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.push(filePath + '/' + fileName)
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.push(filePath + '/' + fileName)
}
if (TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.length > TS.projects.superalgos.globals.loggerVariables.DELETE_QUEUE_SIZE) {
let fileToDelete = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE[0]
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.splice(0, 1)
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.length > TS.projects.superalgos.globals.loggerVariables.DELETE_QUEUE_SIZE) {
let fileToDelete = TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE[0]
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).LOGS_TO_DELETE_QUEUE.splice(0, 1)
/* Will delete this file only if it does not contains ERROR inside. */
let fileContent = fileStorage.getTextFile(fileToDelete, onGetFile, true)
function onGetFile(err, fileContent) {
+1 -1
View File
@@ -29,6 +29,7 @@
We will use a logger for what happens before and after the bot main loop.
*/
VARIABLES_BY_PROCESS_INDEX = {
LOGS_TO_DELETE_QUEUE: [],
PROCESS_INSTANCE_LOGGER_MODULE: DEBUG_MODULE.newDebugLog(processIndex)
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.set(processIndex, VARIABLES_BY_PROCESS_INDEX)
@@ -39,7 +40,6 @@
accesed from where it is needed.
*/
VARIABLES_BY_PROCESS_INDEX = {
LOGS_TO_DELETE_QUEUE: [],
MAIN_LOOP_COUNTER: 0,
PROCESS_KEY:
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].name + '-' +