From e9fdc0e50bd15a6f9be38982a69c23a787e10939 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Sun, 28 Mar 2021 02:26:42 +0000 Subject: [PATCH] FileStorage.js Including Localhost IP Addr Also --- Projects/Superalgos/TS/Task-Modules/FileStorage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Superalgos/TS/Task-Modules/FileStorage.js b/Projects/Superalgos/TS/Task-Modules/FileStorage.js index b7096bb11..737f7b61d 100644 --- a/Projects/Superalgos/TS/Task-Modules/FileStorage.js +++ b/Projects/Superalgos/TS/Task-Modules/FileStorage.js @@ -87,7 +87,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) { logger.write(MODULE_NAME, '[INFO] FileStorage -> getTextFile -> fileLocation: ' + fileLocation) /* Here we actually reaad the file. */ - if (host === undefined || host === 'localhost' || host === ip.address()) { + if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') { /* We read the file from the local file system. */ const fs = require('fs') fs.readFile(fileLocation, onFileRead) @@ -159,7 +159,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) { if (canUsePrevious === true) { logger.write(MODULE_NAME, '[WARN] FileStorage -> getTextFile -> onFileRead -> Could read the file, but could not parse it as it is not a valid JSON. Will try to read the PREVIOUS version instead. -> file = ' + fileLocation) - if (host === undefined || host === 'localhost' || host === ip.address()) { + if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') { /* We read the file from the local file system. */ const fs = require('fs') fs.readFile(fileLocation + '.Previous.json', onPreviousFileRead)