Merge pull request #15 from Superalgos/develop

May progress deployment
This commit is contained in:
benme authored and GitHub committed 2019-05-17 19:33:48 -03:00
commit 83bb0f460c
2 files changed
+21 -32

No files matched your search

+13 -16
View File
@@ -78,8 +78,8 @@ function newDailyFiles () {
case GLOBAL.DEFAULT_OK_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> Received OK Response.') }
beginDateRange = new Date(pFile.begin)
endDateRange = new Date(pFile.end)
beginDateRange = pFile.begin
endDateRange = pFile.end
break
}
@@ -141,23 +141,20 @@ function newDailyFiles () {
switch (err.result) {
case GLOBAL.DEFAULT_OK_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received OK Response.') }
break
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received OK Response.') }
break
}
case GLOBAL.DEFAULT_FAIL_RESPONSE.result: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received FAIL Response.') }
callBackWhenFileReceived(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received FAIL Response.') }
callBackWhenFileReceived(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
}
default: {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received Unexpected Response.') }
callBackWhenFileReceived(err)
return
}
if (INFO_LOG === true) { logger.write('[INFO] initialize -> onFileReceived -> onInitialized -> Received Unexpected Response.') }
callBackWhenFileReceived(err)
return
}
}
fileCursors.set(periodTime, fileCursor)
+8 -16
View File
@@ -66,7 +66,7 @@ function newFileCursor () {
bot = pBot
thisSet = pSet
periodName = pPeriodName
cursorDate = pCursorDate
cursorDate = removeTime(pCursorDate)
timePeriod = pTimePeriod
beginDateRange = pBeginDateRange
endDateRange = pEndDateRange
@@ -194,7 +194,7 @@ function newFileCursor () {
*/
cursorDate = pDatetime // Adjust the cursor date to the one received.
cursorDate = removeTime(pDatetime) // Adjust the cursor date to the one received.
let positionA
@@ -396,7 +396,7 @@ function newFileCursor () {
return
}
cursorDate = pDatetime
cursorDate = removeTime(pDatetime)
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] setDatetime -> err = ' + err.stack) }
}
@@ -445,29 +445,21 @@ function newFileCursor () {
}
}
let compareTargetDate = new Date(targetDate.toDateString())
let compareTargetDate = new Date(targetDate.valueOf())
if (beginDateRange !== undefined) {
let compareBeginDate = new Date(beginDateRange.toDateString())
if (compareTargetDate.valueOf() < compareBeginDate.valueOf()) {
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> Not loading the file for this date.') }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> compareTargetDate = ' + compareTargetDate) }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate < compareBeginDate -> compareBeginDate = ' + compareBeginDate) }
let compareBeginDate = beginDateRange
if (compareTargetDate.valueOf() < compareBeginDate) {
controlLoop()
return
}
}
if (endDateRange !== undefined) {
let compareEndDate = new Date(endDateRange.toDateString())
if (compareTargetDate.valueOf() > compareEndDate.valueOf()) {
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> Not loading the file for this date.') }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> compareTargetDate = ' + compareTargetDate) }
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> getNextFile -> compareTargetDate > compareEndDate -> compareEndDate = ' + compareEndDate) }
let compareEndDate = endDateRange
if (compareTargetDate.valueOf() > compareEndDate) {
controlLoop()
return
}