New bots showing, no cleaning
This commit is contained in:
1 parent
9648c2676b
commit
4d09e8b305
5 files changed
+37
-23
No files matched your search
+15
-6
@@ -9,7 +9,7 @@ function newFileCloud() {
|
||||
|
||||
/*
|
||||
|
||||
This is the module in the system that actually connects to the cloud storage and grabs from there the needed files.
|
||||
This is the module in the system that actually connects to the cloud storage and grabs from there the needed files.
|
||||
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ function newFileCloud() {
|
||||
}
|
||||
}
|
||||
|
||||
function getFile(pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction) {
|
||||
function getFile(pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction, pOperationsId) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -46,9 +46,14 @@ function newFileCloud() {
|
||||
|
||||
const MAX_RETRIES = 3;
|
||||
|
||||
getFileRecursively(0, pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction)
|
||||
|
||||
function getFileRecursively(pRetryCounter, pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction) {
|
||||
if (pOperationsId !== undefined ) {
|
||||
getFileRecursively(0, pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction, pOperationsId)
|
||||
} else {
|
||||
getFileRecursively(0, pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction)
|
||||
}
|
||||
|
||||
function getFileRecursively(pRetryCounter, pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, pSequence, pDataRange, callBackFunction, pOperationsId) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -111,7 +116,11 @@ function newFileCloud() {
|
||||
|
||||
if (pBot !== undefined) {
|
||||
|
||||
filePath = filePath.replace("@Bot", pBot.codeName);
|
||||
if (pOperationsId !== undefined ) {
|
||||
filePath = filePath.replace("@Bot", pBot.codeName + "-" + pOperationsId);
|
||||
} else {
|
||||
filePath = filePath.replace("@Bot", pBot.codeName);
|
||||
}
|
||||
}
|
||||
|
||||
if (pExchange !== undefined) {
|
||||
@@ -249,4 +258,4 @@ function newFileCloud() {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ function newFileSequence() {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize(pDevTeam, pBot, pProduct, pSet, pExchange, pMarket, callBackFunction) {
|
||||
function initialize(pDevTeam, pBot, pProduct, pSet, pExchange, pMarket, callBackFunction, pOperationsId) {
|
||||
|
||||
try {
|
||||
|
||||
@@ -70,7 +70,7 @@ function newFileSequence() {
|
||||
|
||||
}
|
||||
|
||||
intervalHandle = setInterval(updateFiles, _1_MINUTE_IN_MILISECONDS);
|
||||
intervalHandle = setInterval(updateFiles, _1_MINUTE_IN_MILISECONDS);
|
||||
|
||||
if (INFO_LOG === true) { logger.write("[INFO] initialize -> intervalHandle = " + intervalHandle); }
|
||||
|
||||
@@ -85,7 +85,7 @@ function newFileSequence() {
|
||||
|
||||
/* First we will get the sequence max number */
|
||||
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, "Sequence", undefined, onSequenceFileReceived);
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, "Sequence", undefined, onSequenceFileReceived, pOperationsId);
|
||||
|
||||
function onSequenceFileReceived(err, file) {
|
||||
|
||||
@@ -142,7 +142,7 @@ function newFileSequence() {
|
||||
|
||||
for (let i = 0; i <= maxSequence; i++) {
|
||||
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, i, undefined, onFileReceived);
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, i, undefined, onFileReceived, pOperationsId);
|
||||
|
||||
function onFileReceived(err, file) {
|
||||
|
||||
@@ -234,7 +234,7 @@ function newFileSequence() {
|
||||
if (INFO_LOG === true) { logger.write("[INFO] updateFiles -> bot = " + bot.codeName); }
|
||||
if (INFO_LOG === true) { logger.write("[INFO] updateFiles -> thisSet = " + thisSet.codeName); }
|
||||
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, "Sequence", undefined, onSequenceFileReceived);
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, "Sequence", undefined, onSequenceFileReceived, pOperationsId);
|
||||
|
||||
function onSequenceFileReceived(err, file) {
|
||||
|
||||
@@ -287,7 +287,7 @@ function newFileSequence() {
|
||||
|
||||
if (INFO_LOG === true) { logger.write("[INFO] updateFiles -> onSequenceFileReceived -> i = " + i); }
|
||||
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, i, undefined, onFileReceived);
|
||||
fileCloud.getFile(devTeam, bot, thisSet, exchange, market, undefined, undefined, i, undefined, onFileReceived, pOperationsId);
|
||||
|
||||
function onFileReceived(err, file) {
|
||||
|
||||
@@ -382,4 +382,4 @@ function newFileSequence() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user