Async Await implementation at Trading Process

This commit is contained in:
Luis Fernando Molina committed 2020-08-18 14:31:52 +02:00
1 parent ea047363af
commit fdbffef52e
17 files changed
+902 -905

No files matched your search

+20 -1
View File
@@ -20,6 +20,7 @@
finalize: finalize,
load: load,
save: save,
asyncSave: asyncSave,
status: undefined
};
@@ -343,4 +344,22 @@
}
}
};
async function asyncSave() {
let fileName = "Status.Report.json";
let filePath = bot.filePathRoot + "/Reports/" + sessionPath + statusDependencyNode.process;
filePath += '/' + fileName
let fileContent = JSON.stringify(thisObject.file);
let response = await fileStorage.asyncCreateTextFile(filePath, fileContent + '\n', true)
if (response.err.result !== global.DEFAULT_OK_RESPONSE.result) {
throw(response.err)
}
/* All good, lets emit the event that means data has been updated. */
let processOutput = PROCESS_OUTPUT.newProcessOutput(bot, logger)
processOutput.asyncRaiseEvents(thisObject.file.lastFile, thisObject.file.timeFrames)
}
}