Merge pull request #187 from Superalgos/develop

starting task changed by events
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2020-04-04 15:41:27 +02:00
commit 960ed43a70
4 files changed
+14 -9

No files matched your search

+2 -2
View File
@@ -1113,11 +1113,11 @@ function newUiObject () {
}
function drawReferenceLine () {
if (canvas.floatingSpace.drawReferenceLines === false) { return }
if (canvas.floatingSpace.drawReferenceLines === false && thisObject.isOnFocus === false) { return }
if (thisObject.payload.referenceParent === undefined) { return }
if (thisObject.payload.referenceParent.payload === undefined) { return }
if (thisObject.payload.referenceParent.payload.floatingObject === undefined) { return }
if (thisObject.payload.referenceParent.payload.floatingObject.isParentCollapsed === true) { return }
if (thisObject.payload.referenceParent.payload.floatingObject.isParentCollapsed === true && thisObject.isOnFocus === false) { return }
let targetPoint = {
x: thisObject.payload.referenceParent.payload.position.x,
@@ -346,12 +346,18 @@ exports.newUserBot = function newUserBot(bot, logger, COMMONS, UTILITIES, FILE_S
} catch (err) {
if (err.stack.toString().indexOf('ERR_RATE_LIMIT') >= 0) {
logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + bot.exchange + " is saying you are requesting data too often. I will retry the request later, no action is required. To avoid this happening again please increase the rateLimit at the Exchange node config. You might continue seeing this if you are retrieving data from multiple markets at the same time. In this case I tried to get 1 min OHLCVs from " + symbol);
} else {
logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> err = " + err.stack);
return
}
if (err.stack.toString().indexOf('RequestTimeout') >= 0) {
logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> The Exchange " + bot.exchange + " is not responding at the moment. I will save the data already fetched and try to reconnect later to fetch the rest of the missing data." );
return
}
logger.write(MODULE_NAME, "[ERROR] start -> getOHLCVs -> Retrying Later -> err = " + err.stack);
callBackFunction(global.DEFAULT_RETRY_RESPONSE);
abort = true
return
}
}
+2 -2
View File
@@ -72,7 +72,7 @@ function runTask(message) {
id: message.event.taskId,
name: message.event.taskName
}
tasks.set(message.event.taskId, task)
task.childProcess.on('error', (err) => {
@@ -86,7 +86,7 @@ function runTask(message) {
tasks.delete(task.id)
})
setTimeout(sendStartingEvent, 3000)
global.SYSTEM_EVENT_HANDLER.listenToEvent('Task Manager - ' + message.event.taskId, 'Nodejs Process Ready for Task', undefined, undefined, undefined, sendStartingEvent)
function sendStartingEvent() {
//console.log('[INFO] Task Manager -> server -> runTask -> Emitting Event -> key = ' + 'Task Server - ' + task.id)
+1 -2
View File
@@ -27,8 +27,6 @@ global.CUSTOM_FAIL_RESPONSE = {
const ONE_DAY_IN_MILISECONDS = 24 * 60 * 60 * 1000;
/* Process Events */
process.on('uncaughtException', function (err) {
console.log('[ERROR] Task Server -> server -> uncaughtException -> err.message = ' + err.message)
console.log('[ERROR] Task Server -> server -> uncaughtException -> err.stack = ' + err.stack)
@@ -122,6 +120,7 @@ function preLoader() {
try {
//console.log('[INFO] Task Server -> server -> preLoader -> Listening to starting event -> key = ' + 'Task Server - ' + taskId)
global.SYSTEM_EVENT_HANDLER.listenToEvent('Task Server - ' + taskId, 'Run Task', undefined, undefined, undefined, eventReceived)
global.SYSTEM_EVENT_HANDLER.raiseEvent('Task Manager - ' + taskId, 'Nodejs Process Ready for Task')
function eventReceived(message) {
global.TASK_NODE = message
global.TASK_NODE = JSON.parse(message.event.definition)