diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index 09a45e0d9..a180a9fdf 100644 Binary files a/.vs/AAWeb/v15/.suo and b/.vs/AAWeb/v15/.suo differ diff --git a/Files/FileCloud.js b/Files/FileCloud.js index 419f2c374..fd172c5a0 100644 --- a/Files/FileCloud.js +++ b/Files/FileCloud.js @@ -109,7 +109,7 @@ function newFileCloud() { if (err) { - if (err.code === "BlobNotFound") { + if (err.code === "BlobNotFound" | err.code === "FileNotFound" | err.code === "ParentNotFound") { let customErr = { result: GLOBAL.CUSTOM_FAIL_RESPONSE.result, diff --git a/Files/FileCursor.js b/Files/FileCursor.js index 3eef33dab..1a716c103 100644 --- a/Files/FileCursor.js +++ b/Files/FileCursor.js @@ -400,8 +400,17 @@ function newFileCursor() { if (INFO_LOG === true) { logger.write("[INFO] getFiles -> onFileReceived -> Received CUSTOM FAIL Response."); } if (INFO_LOG === true) { logger.write("[INFO] getFiles -> onFileReceived -> err.message = " + err.message); } - callBackFunction(err); - return; + if (err.message === "File does not exist.") { + + controlLoop(); + return; + + } else { + + callBackFunction(err); + return; + } + } default: { diff --git a/ProductStorage.js b/ProductStorage.js index 97fb04876..1893beffc 100644 --- a/ProductStorage.js +++ b/ProductStorage.js @@ -75,7 +75,7 @@ function newProductStorage(pName) { if (INFO_LOG === true) { logger.write("[INFO] initialize -> Market Files -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } let marketFiles = newMarketFiles(); - marketFiles.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, onCacheFileReady); + marketFiles.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, onMarketFileReady); thisObject.marketFiles.push(marketFiles); dataSetsToLoad++; } @@ -86,7 +86,7 @@ function newProductStorage(pName) { if (INFO_LOG === true) { logger.write("[INFO] initialize -> Daily Files -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } let dailyFiles = newDailyFiles(); - dailyFiles.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, pDatetime, pTimePeriod, onFileCursorReady); + dailyFiles.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, pDatetime, pTimePeriod, onDailyFileReady); thisObject.dailyFiles.push(dailyFiles); dataSetsToLoad++; } @@ -115,31 +115,31 @@ function newProductStorage(pName) { break; } - function onCacheFileReady(err, pCaller) { + function onMarketFileReady(err, pCaller) { try { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> Entering function."); } - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> Entering function."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } switch (err.result) { case GLOBAL.DEFAULT_OK_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> Received OK Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> Received OK Response."); } break; } case GLOBAL.DEFAULT_FAIL_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> Received FAIL Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> Received FAIL Response."); } callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE); return; } case GLOBAL.CUSTOM_FAIL_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> Received CUSTOM FAIL Response."); } - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> err.message = " + err.message); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> Received CUSTOM FAIL Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> err.message = " + err.message); } callBackFunction(err); return; @@ -147,7 +147,7 @@ function newProductStorage(pName) { default: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onCacheFileReady -> Received Unexpected Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onMarketFileReady -> Received Unexpected Response."); } callBackFunction(err); return; } @@ -169,36 +169,36 @@ function newProductStorage(pName) { } catch (err) { - if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> onCacheFileReady -> err = " + err); } + if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> onMarketFileReady -> err = " + err); } callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE); } } - function onFileCursorReady(err, pCaller) { + function onDailyFileReady(err, pCaller) { try { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> Entering function."); } - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> Entering function."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } switch (err.result) { case GLOBAL.DEFAULT_OK_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> Received OK Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> Received OK Response."); } break; } case GLOBAL.DEFAULT_FAIL_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> Received FAIL Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> Received FAIL Response."); } callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE); return; } case GLOBAL.CUSTOM_FAIL_RESPONSE.result: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> Received CUSTOM FAIL Response."); } - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> err.message = " + err.message); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> Received CUSTOM FAIL Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> err.message = " + err.message); } callBackFunction(err); return; @@ -206,7 +206,7 @@ function newProductStorage(pName) { default: { - if (INFO_LOG === true) { logger.write("[INFO] initialize -> onFileCursorReady -> Received Unexpected Response."); } + if (INFO_LOG === true) { logger.write("[INFO] initialize -> onDailyFileReady -> Received Unexpected Response."); } callBackFunction(err); return; } @@ -228,7 +228,7 @@ function newProductStorage(pName) { } catch (err) { - if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> onFileCursorReady -> err = " + err); } + if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> onDailyFileReady -> err = " + err); } callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE); } } diff --git a/TimelineChart.js b/TimelineChart.js index 767bb192c..6fd38b31c 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -1,7 +1,7 @@ function newTimelineChart() { const MODULE_NAME = "Timeline Chart"; - const INFO_LOG = true; + const INFO_LOG = false; const INTENSIVE_LOG = false; const ERROR_LOG = true; const logger = newDebugLog(); @@ -353,19 +353,26 @@ if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> Received FAIL Response."); } failCounter++; - return; + break; } default: { if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> Received Unexpected Response."); } failCounter++; - return; + break; } } + if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> initializationCounter = " + initializationCounter); } + if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> okCounter = " + okCounter); } + if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> failCounter = " + failCounter); } + if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> loadingProductCards.length = " + loadingProductCards.length); } + if (initializationCounter === loadingProductCards.length) { // This was the last one. + if (INFO_LOG === true) { logger.write("[INFO] initializeProductPlotters -> onProductPlotterInitialized -> onProductPlotterInitialized -> Last Product Loaded."); } + /* If less than 50% of plotters are initialized then we return FAIL. */ if (okCounter >= 1) {