Indicator and Extractors types are now up to date

This commit is contained in:
Luis Fernando Molina committed 2018-05-24 15:38:04 +02:00
1 parent ac31635cb3
commit c04365ea6a
2 files changed
+40 -84

No files matched your search

+20 -42
View File
@@ -46,62 +46,40 @@
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
let filePath = bot.devTeam + "/" + bot.repo + "/" + pProcessConfig.name;
let fileName = "User.Bot.js";
/* We needed the cloudStorage initialized for both requesting the bot source code and, later requesting the AACloud condig at ShallWeStop function. */
cloudStorage.getTextFile(filePath, fileName, onFileReceived);
const CLOUD_REQUIRE = require(ROOT_DIR + 'CloudRequire');
let cloudRequire = CLOUD_REQUIRE.newCloudRequire(bot, DEBUG_MODULE);
function onFileReceived(err, text) {
cloudRequire.downloadBot(cloudStorage, pProcessConfig, onBotDownloaded);
function onBotDownloaded(err, pMODULE) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
logger.write("[ERROR] initialize -> onInizialized -> onFileReceived -> err.message = " + err.message);
logger.write("[ERROR] initialize -> onInizialized -> onBotDownloaded -> err.message = " + err.message);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
bot.eventHandler.raiseEvent("Loop Finished");
return;
}
try {
USER_BOT_MODULE = pMODULE;
USER_BOT_MODULE = {};
USER_BOT_MODULE.newUserBot = eval(text);
cloudRequire.downloadCommons(cloudStorage, onCommonsDownloaded);
filePath = bot.devTeam + "/" + bot.repo;
fileName = "Commons.js";
function onCommonsDownloaded(err, pMODULE) {
cloudStorage.getTextFile(filePath, fileName, onFileReceived);
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
function onFileReceived(err, text) {
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
// Nothing happens since COMMONS modules are optional.
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
try {
COMMONS_MODULE = {};
COMMONS_MODULE.newCommons = eval(text);
filePath = bot.devTeam + "/" + bot.repo;
fileName = "Commons.js";
callBackFunction(global.DEFAULT_OK_RESPONSE);
} catch (err) {
logger.write("[ERROR] initialize -> onInizialized -> onFileReceived -> onFileReceived -> err.message = " + err.message);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
bot.eventHandler.raiseEvent("Loop Finished");
return;
}
logger.write("[ERROR] initialize -> onInizialized -> onBotDownloaded -> onCommonsDownloaded -> err.message = " + err.message);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
bot.eventHandler.raiseEvent("Loop Finished");
return;
}
} catch (err) {
logger.write("[ERROR] initialize -> onInizialized -> onFileReceived -> err.message = " + err.message);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
bot.eventHandler.raiseEvent("Loop Finished");
return;
COMMONS_MODULE = pMODULE;
callBackFunction(global.DEFAULT_OK_RESPONSE);
}
}
@@ -484,7 +462,7 @@
let configRead = JSON.parse(text);
if (configRead.stopGracefully === false) {
if (configRead.stopGracefully === false && global.SHALL_BOT_STOP === false) {
continueCallBack();
} else {
stopCallBack();