Merge pull request #100 from AAVikings/master
Fixing retry on getTextFile
This commit is contained in:
4 files changed
+12
-13
No files matched your search
+3
-5
@@ -10,7 +10,7 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger)
|
||||
|
||||
const MODULE_NAME = "Azure Blob Storage";
|
||||
const RETRY_WAIT_TIME = 10000;
|
||||
const MAX_RETRIES = 30;
|
||||
const MAX_RETRIES = 5;
|
||||
|
||||
let AZURE_STORAGE = require('./AzureStorage')
|
||||
let storage = AZURE_STORAGE.newAzureStorage(bot, logger);
|
||||
@@ -230,7 +230,7 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger)
|
||||
logger.write(MODULE_NAME, "[INFO] getTextFile -> onFileReceived -> text = " + text);
|
||||
}
|
||||
|
||||
if (err || text === undefined) {
|
||||
if (err) {
|
||||
|
||||
if (ERROR_LOG === true && logger !== undefined && err.code !== 'BlobNotFound') {
|
||||
logger.write(MODULE_NAME, "[ERROR] getTextFile -> onFileReceived -> Error trying to get this file.");
|
||||
@@ -238,7 +238,6 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger)
|
||||
logger.write(MODULE_NAME, "[ERROR] getTextFile -> onFileReceived -> pFolderPath = " + pFolderPath);
|
||||
logger.write(MODULE_NAME, "[ERROR] getTextFile -> onFileReceived -> pFileName = " + pFileName);
|
||||
logger.write(MODULE_NAME, "[ERROR] getTextFile -> onFileReceived -> err.code = " + err.code);
|
||||
logger.write(MODULE_NAME, "[ERROR] getTextFile -> onFileReceived -> text = " + text);
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -251,8 +250,7 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger)
|
||||
err.code === 'EAI_AGAIN' ||
|
||||
err.code === 'AuthenticationFailed' ||
|
||||
err.code === 'OperationTimedOut' ||
|
||||
err.code === 'ServerBusy' ||
|
||||
text === undefined
|
||||
err.code === 'ServerBusy'
|
||||
) {
|
||||
|
||||
setTimeout(retryCreateFile, RETRY_WAIT_TIME);
|
||||
|
||||
+7
-6
@@ -419,11 +419,16 @@
|
||||
let fileName = "Execution.Context." + bot.startMode + "." + runIndex +".json";
|
||||
let dateForPath = bot.processDatetime.getUTCFullYear() + '/' + utilities.pad(bot.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(bot.processDatetime.getUTCDate(), 2) + '/' + utilities.pad(bot.processDatetime.getUTCHours(), 2) + '/' + utilities.pad(bot.processDatetime.getUTCMinutes(), 2);
|
||||
let filePath = bot.filePathRoot + "/Output/" + bot.process + '/' + dateForPath;
|
||||
let fileContent = JSON.stringify(thisObject.executionContext);
|
||||
|
||||
if(fileContent === undefined){
|
||||
logger.write(MODULE_NAME, "[ERROR] saveThemAll -> writeExecutionContext -> executionContext is undefined.");
|
||||
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
|
||||
}
|
||||
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] saveThemAll -> writeExecutionContext -> fileName = " + fileName); }
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] saveThemAll -> writeExecutionContext -> filePath = " + filePath); }
|
||||
|
||||
let fileContent = JSON.stringify(thisObject.executionContext);
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logContent === true) { logger.write(MODULE_NAME, "[INFO] saveThemAll -> writeExecutionContext -> fileContent = " + fileContent); }
|
||||
|
||||
cloudStorage.createTextFile(filePath, fileName, fileContent + '\n', onFileCreated);
|
||||
|
||||
@@ -437,10 +442,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (global.LOG_CONTROL[MODULE_NAME].logContent === true) {
|
||||
logger.write(MODULE_NAME, "[INFO] saveThemAll -> writeExecutionContext -> onFileCreated -> Content written = " + fileContent);
|
||||
}
|
||||
|
||||
writeExucutionHistory(callBack);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
logInfo: true,
|
||||
logWarnings: false,
|
||||
logErrors: true,
|
||||
logContent: false,
|
||||
logContent: true,
|
||||
intensiveLogging: false
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@superalgos/clone-executor",
|
||||
"version": "1.0.8",
|
||||
"version": "1.0.9",
|
||||
"description": "Module responsible for executing the bots on the cloud.",
|
||||
"author": "Superalgos, ltd.",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Reference in new issue
Block a user