COMMONS module introduced

This commit is contained in:
Luis Fernando Molina committed 2018-03-15 20:32:31 +01:00
1 parent a8da33e9e8
commit 73bc3d020e
8 files changed
+37 -16

No files matched your search

Binary file not shown.
+9 -9
View File
@@ -24,23 +24,23 @@
try {
folderPath = '../../Logs';
folderPath = '../Logs';
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam;
folderPath = '../Logs/' + thisObject.bot.devTeam;
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type;
folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type;
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor;
folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor;
createFolderSync(folderPath);
folderPath = '../../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process;
folderPath = '../Logs/' + thisObject.bot.devTeam + "/" + thisObject.bot.type + "/" + thisObject.bot.codeName + "." + thisObject.bot.version.major + "." + thisObject.bot.version.minor + "/" + thisObject.bot.process;
createFolderSync(folderPath);
@@ -81,7 +81,7 @@
function createFolderSync(name) {
try {
fileSystem.mkdirSync( './logs/' + name)
fileSystem.mkdirSync( name)
} catch (err) {
if (err.code !== 'EEXIST') throw err
}
@@ -96,7 +96,7 @@
try {
for (i = 1; i < 1000000; i++) {
filePath = './logs/' + relativePath + i + "." + fileName + '.log';
filePath = relativePath + i + "." + fileName + '.log';
stats = fileSystem.statSync(filePath);
}
}
@@ -104,14 +104,14 @@
if (i > 1) {
filePath = './logs/' + relativePath + (i - 1) + "." + fileName + '.log';
filePath = relativePath + (i - 1) + "." + fileName + '.log';
stats = fileSystem.statSync(filePath);
const fileSizeInBytes = stats.size;
if (fileSizeInBytes > 10240000) {
filePath = './logs/' + relativePath + i + "." + fileName + '.log';
filePath = relativePath + i + "." + fileName + '.log';
}
return filePath;
+8 -1
View File
@@ -7,6 +7,7 @@
const FULL_LOG = true;
let USER_BOT_MODULE;
let COMMONS_MODULE;
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
const logger = DEBUG_MODULE.newDebugLog();
@@ -30,6 +31,12 @@
USER_BOT_MODULE = require(pBotPath + "/" + pProcessConfig.name + "/" + 'User.Bot');
try {
COMMONS_MODULE = require(pBotPath + "/" + 'Commons');
} catch (err) {
// Nothing happens since COMMONS modules are optional.
}
callBackFunction(global.DEFAULT_OK_RESPONSE);
} catch (err) {
@@ -73,7 +80,7 @@
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); }
usertBot = USER_BOT_MODULE.newUserBot(bot, UTILITIES, DEBUG_MODULE, FILE_STORAGE, STATUS_REPORT);
usertBot = USER_BOT_MODULE.newUserBot(bot, COMMONS_MODULE, UTILITIES, DEBUG_MODULE, FILE_STORAGE, STATUS_REPORT);
usertBot.initialize(undefined, undefined, onInizialized);
+2 -3
View File
@@ -7,13 +7,13 @@
<ProjectHome />
<ProjectView>ShowAllFiles</ProjectView>
<StartupFile>Run.js</StartupFile>
<WorkingDirectory>C:\Users\Luis\source\repos\AACloudPlatform</WorkingDirectory>
<WorkingDirectory>C:\Users\Luis\source\repos\AACloud</WorkingDirectory>
<OutputPath>.</OutputPath>
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
<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>
@@ -51,7 +51,6 @@
</ItemGroup>
<ItemGroup>
<Content Include=".gitignore" />
<Content Include="platform.config.json" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
+6 -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'
/* You do not have funds at the exchange and still want run your bot? No problem activate the exchange simulation mode: */
@@ -88,6 +88,11 @@ global.DEFAULT_RETRY_RESPONSE = {
message: "Retry Later"
};
global.CUSTOM_OK_RESPONSE = {
result: "Ok, but check Message",
message: "Custom Message"
};
global.CUSTOM_FAIL_RESPONSE = {
result: "Fail Because",
message: "Custom Message"
+8 -1
View File
@@ -7,6 +7,7 @@
const FULL_LOG = true;
let USER_BOT_MODULE;
let COMMONS_MODULE;
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
const logger = DEBUG_MODULE.newDebugLog();
@@ -30,6 +31,12 @@
USER_BOT_MODULE = require(pBotPath + "/" + pProcessConfig.name + "/" + 'User.Bot');
try {
COMMONS_MODULE = require(pBotPath + "/" + 'Commons');
} catch (err) {
// Nothing happens since COMMONS modules are optional.
}
callBackFunction(global.DEFAULT_OK_RESPONSE);
} catch (err) {
@@ -215,7 +222,7 @@
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeUserBot -> Entering function."); }
usertBot = USER_BOT_MODULE.newUserBot(bot, DEBUG_MODULE);
usertBot = USER_BOT_MODULE.newUserBot(bot, DEBUG_MODULE, COMMONS_MODULE);
let platform = {
datasource: datasource,
@@ -1,3 +1,6 @@
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
C:\Users\Luis\source\repos\AACloud\obj\Debug\Project.njsprojResolveAssemblyReference.cache
C:\Users\Luis\source\repos\AACloud\obj\Debug\Project.njsproj.CoreCompileInputs.cache
C:\Users\Luis\source\repos\AACloud\bin\Microsoft.NodejsTools.WebRole.dll
+1 -1
View File
@@ -6,7 +6,7 @@
"patch": 0
},
"bot": {
"path": "../Bots/AAMasters/AAMariam-Trading-Bot"
"path": "../Bots/AAMasters/AAOlivia-Indicator-Bot"
},
"stopGracefully": "false"
}