From 97f5885a13831a95407704e0f02a6d3aac5e805d Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 21 Apr 2019 19:05:59 +0200 Subject: [PATCH] If a file is missing, wont halt initialization --- ProductStorage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ProductStorage.js b/ProductStorage.js index 93bc938fd..66c3ea939 100644 --- a/ProductStorage.js +++ b/ProductStorage.js @@ -186,7 +186,8 @@ function newProductStorage (pName) { let event = { totalValue: pCaller.getExpectedFiles(), - currentValue: pCaller.getFilesLoaded() + currentValue: pCaller.getFilesLoaded(), + filesNotLoaded: pCaller.getFilesNotLoaded() } thisObject.eventHandler.raiseEvent('Market File Loaded', event) @@ -194,7 +195,7 @@ function newProductStorage (pName) { if (INFO_LOG === true) { logger.write('[INFO] initialize -> onMarketFileReady -> event.currentValue = ' + event.currentValue) } if (INFO_LOG === true) { logger.write('[INFO] initialize -> onMarketFileReady -> event.totalValue = ' + event.totalValue) } - if (event.currentValue === event.totalValue) { + if (event.currentValue + event.filesNotLoaded === event.totalValue) { dataSetsLoaded++ if (INFO_LOG === true) { logger.write('[INFO] initialize -> onMarketFileReady -> dataSetsLoaded = ' + dataSetsLoaded) } @@ -424,4 +425,3 @@ function newProductStorage (pName) { } } } -