Bug Dataset Updated Fixed
This commit is contained in:
1 parent
280344605d
commit
df7bea0836
2 files changed
+23
-22
No files matched your search
+19
-19
@@ -1,5 +1,5 @@
|
||||
|
||||
function newFileCursor () {
|
||||
function newFileCursor() {
|
||||
const MODULE_NAME = 'File Cursor'
|
||||
const INFO_LOG = false
|
||||
const ERROR_LOG = true
|
||||
@@ -43,7 +43,7 @@ function newFileCursor () {
|
||||
|
||||
return thisObject
|
||||
|
||||
function finalize () {
|
||||
function finalize() {
|
||||
try {
|
||||
eventsServerClient.stopListening('Dataset Updated', eventSubscriptionIdDatasetUpdated)
|
||||
eventsServerClient.stopListening('Data Range Updated', eventSubscriptionIdDataRangeUpdated)
|
||||
@@ -75,7 +75,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize (
|
||||
function initialize(
|
||||
pFileCloud,
|
||||
pDataMine,
|
||||
pBot,
|
||||
@@ -118,11 +118,11 @@ function newFileCursor () {
|
||||
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
|
||||
|
||||
function onResponseDataSet (message) {
|
||||
function onResponseDataSet(message) {
|
||||
eventSubscriptionIdDatasetUpdated = message.eventSubscriptionId
|
||||
}
|
||||
|
||||
function onResponseDataRange (message) {
|
||||
function onResponseDataRange(message) {
|
||||
eventSubscriptionIdDataRangeUpdated = message.eventSubscriptionId
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -131,7 +131,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function updateDataRange (message) {
|
||||
function updateDataRange(message) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -156,7 +156,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function updateFiles (message) {
|
||||
function updateFiles(message) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -170,7 +170,7 @@ function newFileCursor () {
|
||||
|
||||
fileCloud.getFile(dataMine, bot, session, product, dataset, exchange, market, periodName, targetDate, undefined, undefined, undefined, onFileReceived)
|
||||
|
||||
function onFileReceived (err, file) {
|
||||
function onFileReceived(err, file) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -188,7 +188,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function setTimeFrame (pTimeFrame, pDatetime) {
|
||||
function setTimeFrame(pTimeFrame, pDatetime) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -225,7 +225,7 @@ function newFileCursor () {
|
||||
enterSavingMode()
|
||||
}
|
||||
|
||||
function enterSavingMode () {
|
||||
function enterSavingMode() {
|
||||
try {
|
||||
switch (timeFrame) {
|
||||
|
||||
@@ -302,7 +302,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function exitSavingMode () {
|
||||
function exitSavingMode() {
|
||||
try {
|
||||
switch (timeFrame) {
|
||||
|
||||
@@ -383,7 +383,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function setDatetime (pDatetime) {
|
||||
function setDatetime(pDatetime) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -398,7 +398,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function reload (callBackFunction) {
|
||||
function reload(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -411,7 +411,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function getFiles (callBackFunction) {
|
||||
function getFiles(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -422,7 +422,7 @@ function newFileCursor () {
|
||||
|
||||
getNextFile()
|
||||
|
||||
function getNextFile () {
|
||||
function getNextFile() {
|
||||
try {
|
||||
let targetDate = new Date(cursorDate)
|
||||
targetDate.setUTCDate(targetDate.getUTCDate() + j)
|
||||
@@ -479,7 +479,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function onFileReceived (err, file) {
|
||||
function onFileReceived(err, file) {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> onFileReceived -> Entering function.') }
|
||||
|
||||
@@ -524,7 +524,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function controlLoop () {
|
||||
function controlLoop() {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFiles -> controlLoop -> Entering function.') }
|
||||
|
||||
@@ -548,7 +548,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function collectGarbage (callBackFunction) {
|
||||
function collectGarbage(callBackFunction) {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
|
||||
@@ -570,7 +570,7 @@ function newFileCursor () {
|
||||
}
|
||||
}
|
||||
|
||||
function getExpectedFiles () {
|
||||
function getExpectedFiles() {
|
||||
if (finalized === true) { return }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getExpectedFiles -> Entering function.') }
|
||||
|
||||
|
||||
+4
-3
@@ -207,7 +207,6 @@ function newMarketFiles() {
|
||||
try {
|
||||
if (finalized === true) { return }
|
||||
let updatedFiles = 0
|
||||
if (message.event === undefined) { return }
|
||||
|
||||
/* Now we will get the market files */
|
||||
|
||||
@@ -216,8 +215,10 @@ function newMarketFiles() {
|
||||
let periodName = marketFilesPeriods[i][1]
|
||||
|
||||
if (dataset.config.validTimeFrames.includes(periodName) !== true) { continue }
|
||||
if (message.event.timeFrames !== undefined) {
|
||||
if (message.event.timeFrames.includes(periodName) !== true) { continue }
|
||||
if (message.event !== undefined) {
|
||||
if (message.event.timeFrames !== undefined) {
|
||||
if (message.event.timeFrames.includes(periodName) !== true) { continue }
|
||||
}
|
||||
}
|
||||
fileCloud.getFile(dataMine, bot, session, product, dataset, exchange, market, periodName, undefined, undefined, undefined, undefined, onFileReceived)
|
||||
|
||||
|
||||
Reference in new issue
Block a user