TASK_IS_STOPPING
This commit is contained in:
1 parent
58c58b706d
commit
a57374783a
17 files changed
+47
-31
No files matched your search
@@ -350,6 +350,12 @@
|
||||
"functionName": "newSuperalgosGlobalsProcessVariables",
|
||||
"fileName": "ProcessVariables.js"
|
||||
},
|
||||
{
|
||||
"name": "Task Variables",
|
||||
"propertyName": "taskVariables",
|
||||
"functionName": "newSuperalgosGlobalsTaskVariables",
|
||||
"fileName": "TaskVariables.js"
|
||||
},
|
||||
{
|
||||
"name": "NODE JS Constants",
|
||||
"propertyName": "nodeJSConstants",
|
||||
|
||||
+4
-4
@@ -134,7 +134,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
function start(callBackFunction) {
|
||||
try {
|
||||
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
@@ -149,7 +149,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
await getFirstId()
|
||||
await getOHLCVs()
|
||||
if (abort === true) { return }
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
@@ -347,7 +347,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
|
||||
if (
|
||||
OHLCVs.length < limit - 1 ||
|
||||
global.STOP_TASK_GRACEFULLY === true ||
|
||||
TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true ||
|
||||
allOHLCVs.length >= MAX_OHLCVs_PER_EXECUTION
|
||||
) {
|
||||
break
|
||||
@@ -603,7 +603,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
}
|
||||
|
||||
function controlLoop() {
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
+4
-4
@@ -109,7 +109,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
function start(callBackFunction) {
|
||||
try {
|
||||
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
@@ -124,7 +124,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
await getFirstId()
|
||||
await getTrades()
|
||||
if (abort === true) { return}
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
@@ -270,7 +270,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
|
||||
if (
|
||||
trades.length < limit - 1 ||
|
||||
global.STOP_TASK_GRACEFULLY === true ||
|
||||
TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true ||
|
||||
allTrades.length >= MAX_TRADES_PER_EXECUTION
|
||||
) {
|
||||
break
|
||||
@@ -431,7 +431,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
|
||||
}
|
||||
function controlLoop() {
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
|
||||
function start(callBackFunction) {
|
||||
try {
|
||||
|
||||
if (global.STOP_TASK_GRACEFULLY === true) {
|
||||
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
|
||||
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
|
||||
return
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
exports.newSuperalgosGlobalsTaskVariables = function () {
|
||||
/*
|
||||
Since the moment the task is stopped by the UI untiil the time the task can be stopped gracefully,
|
||||
we turn on this switch that will signal every internal procedure that it must stop.
|
||||
*/
|
||||
let thisObject = {
|
||||
IS_TASK_STOPPING: false
|
||||
}
|
||||
|
||||
return thisObject
|
||||
}
|
||||
Reference in new issue
Block a user