Initialization debugged

This commit is contained in:
Luis Fernando Molina committed 2018-03-15 10:21:02 +01:00
1 parent f988a33603
commit 5e0dd485c9
10 files changed
+26 -23

No files matched your search

Binary file not shown.
+1 -1
View File
@@ -268,7 +268,7 @@ exports.newAzureFileStorage = function newAzureFileStorage(BOT) {
message: "Folder does not exist."
};
logger.write("[ERROR] getTextFile -> onFileReceived -> Custom Response -> message = " + customResponse.message);
logger.write("[ERROR] getTextFile -> onFileReceived -> Custom Response -> message = " + customErr.message);
callBackFunction(customErr);
return;
-4
View File
@@ -36,10 +36,6 @@
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName;
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor;
createFolderSync(folderPath);
+8 -6
View File
@@ -53,7 +53,7 @@
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
const UTILITIES = require(ROOT_DIR + 'Utilities');
const AZURE_FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
const STATUS_REPORT = require(ROOT_DIR + 'Status Report');
@@ -74,8 +74,8 @@
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeStatusReport -> Entering function."); }
statusReport = STATUS_REPORT.newContext(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES);
statusReport.initialize(onInizialized);
statusReport = STATUS_REPORT.newStatusReport(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES);
statusReport.initialize(bot, onInizialized);
function onInizialized(err) {
@@ -85,20 +85,22 @@
initializeUserBot();
return;
}
break;
case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time.
logger.write("[ERROR] run -> loop -> initializeStatusReport -> onInizialized > Retry Later. Requesting Execution Retry.");
nextWaitTime = 'Retry';
loopControl(nextWaitTime);
return;
}
break;
case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
logger.write("[ERROR] run -> loop -> initializeStatusReport -> onInizialized > Operation Failed. Aborting the process.");
callBackFunction(err);
return;
}
break;
case global.CUSTOM_FAIL_RESPONSE.result: {
logger.write("[INFO] run -> loop -> initializeStatusReport -> onInizialized > Execution finished with some expected issue.");
initializeUserBot();
return;
}
}
}
}
+2 -2
View File
@@ -124,12 +124,12 @@
if (shutdownEvent.isShuttingDown() === false) {
const UTILITIES = require(ROOT_DIR + 'Utilities');
const AZURE_FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const MARKETS_MODULE = require(ROOT_DIR + 'Markets');
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
const POLONIEX_CLIENT_MODULE = require(ROOT_DIR + 'Poloniex API Client');
let fileProcessingInterval = INTERVAL_MODULE.newInterval(bot, UTILITIES, AZURE_FILE_STORAGE, DEBUG_MODULE, MARKETS_MODULE, POLONIEX_CLIENT_MODULE);
let fileProcessingInterval = INTERVAL_MODULE.newInterval(bot, UTILITIES, FILE_STORAGE, DEBUG_MODULE, MARKETS_MODULE, POLONIEX_CLIENT_MODULE);
fileProcessingInterval.initialize(year, month, onReadyToStart);
+1 -1
View File
@@ -13,7 +13,7 @@
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<Name>Project</Name>
<ScriptArguments>Trading-Process</ScriptArguments>
<ScriptArguments>Multi-Period-Market</ScriptArguments>
<NodeExePath>C:\Program Files\nodejs\node.exe</NodeExePath>
<StartWebBrowser>False</StartWebBrowser>
</PropertyGroup>
+1 -1
View File
@@ -3,7 +3,7 @@ const FULL_LOG = true;
/* The following global variable tells the system if it is running on test mode or production. */
global.RUNNING_MODE = 'Production'; // 'Testnet' or 'Production'
global.RUNNING_MODE = 'Mixed'; // 'Testnet' or 'Production'
/* First thing to do is to read the config and guess which bot we will be running. */
+9 -5
View File
@@ -87,19 +87,21 @@
callBackFunction(global.DEFAULT_OK_RESPONSE);
return;
}
break;
case global.DEFAULT_RETRY_RESPONSE.result: { // Something bad happened, but if we retry in a while it might go through the next time.
logger.write("[ERROR] initialize -> onDone -> Retry Later. Requesting Execution Retry.");
callBackFunction(err);
return;
}
break;
case global.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
logger.write("[ERROR] initialize -> onDone -> Operation Failed. Aborting the process.");
callBackFunction(err);
return;
}
break;
case global.CUSTOM_FAIL_RESPONSE.result: {
logger.write("[INFO] initialize -> onDone -> Execution finished with some expected issue.");
callBackFunction(err);
return;
}
}
} catch (err) {
@@ -129,12 +131,14 @@
/* In this case we can assume that this is the first execution ever of this bot.*/
thisObject.statusReport = JSON.parse('{}');
let customErr = {
result: global.CUSTOM_FAIL_RESPONSE.result,
message: "Status Report was never created."
}
logger.write("[ERROR] save -> err = " + err.message);
callBackFunction(customErr);
callBack(customErr);
return;
}
@@ -173,7 +177,7 @@
} catch (err) {
logger.write("[ERROR] initialize -> err = " + err.message);
callBackFunction(global.DEFAULT_FAIL_RESPONSE);
callBack(global.DEFAULT_FAIL_RESPONSE);
}
}
+3 -3
View File
@@ -53,7 +53,7 @@
/* We define here all the modules that the rest of the infraestructure, including the bots themselves can consume. */
const UTILITIES = require(ROOT_DIR + 'Utilities');
const AZURE_FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const FILE_STORAGE = require(ROOT_DIR + 'Azure File Storage');
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
const POLONIEX_CLIENT_MODULE = require(ROOT_DIR + 'Poloniex API Client');
const EXCHANGE_API = require(ROOT_DIR + 'ExchangeAPI');
@@ -83,7 +83,7 @@
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeContext -> Entering function."); }
context = CONTEXT.newContext(bot, DEBUG_MODULE, AZURE_FILE_STORAGE, UTILITIES, STATUS_REPORT);
context = CONTEXT.newContext(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES, STATUS_REPORT);
context.initialize(onInizialized);
function onInizialized(err) {
@@ -116,7 +116,7 @@
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeDatasource -> Entering function."); }
datasource = DATASOURCE.newDatasource(bot, DEBUG_MODULE, AZURE_FILE_STORAGE, UTILITIES);
datasource = DATASOURCE.newDatasource(bot, DEBUG_MODULE, FILE_STORAGE, UTILITIES);
datasource.initialize(onInizialized);
function onInizialized(err) {
@@ -1,2 +1,3 @@
C:\Users\Luis\source\repos\AACloudPlatform\obj\Debug\Project.njsproj.CoreCompileInputs.cache
C:\Users\Luis\source\repos\AACloudPlatform\bin\Microsoft.NodejsTools.WebRole.dll
C:\Users\Luis\source\repos\AACloudPlatform\obj\Debug\Project.njsprojResolveAssemblyReference.cache