file storage ok

This commit is contained in:
Luis Fernando Molina committed 2020-12-01 13:03:28 +01:00
1 parent f69d2b69ec
commit e2e3a87ea8
6 files changed
+10 -7

No files matched your search

+5 -2
View File
@@ -1,19 +1,22 @@
const path = require('path')
exports.newFileStorage = function newFileStorage(logger, host, port) {
exports.newFileStorage = function newFileStorage(host, port) {
const MODULE_NAME = 'FileStorage'
const MAX_RETRY = 10
const FAST_RETRY_TIME_IN_MILISECONDS = 500
const SLOW_RETRY_TIME_IN_MILISECONDS = 2000
if (logger === undefined) { // Dummy logger
let logger
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE === undefined) { // Dummy logger
logger = {}
function write() {
}
logger.write = write
} else {
logger = TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE
}
let thisObject = {
+1 -1
View File
@@ -93,7 +93,7 @@
}
/* For each loop we want to create a new log file. */
if (logger !== undefined) {
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE !== undefined) {
logger.finalize()
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE = DEBUG_MODULE.newDebugLog(processIndex)
+1 -1
View File
@@ -98,7 +98,7 @@
}
/* For each loop we want to create a new log file. */
if (logger !== undefined) {
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE !== undefined) {
logger.finalize()
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE = DEBUG_MODULE.newDebugLog(processIndex)
+1 -1
View File
@@ -55,7 +55,7 @@
}
/* For each loop we want to create a new log file. */
if (logger !== undefined) {
if (TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE !== undefined) {
logger.finalize()
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE = DEBUG_MODULE.newDebugLog(processIndex)