From 43e940bcf25d44811c389bb4502d4cd5c9153c8c Mon Sep 17 00:00:00 2001 From: Fotis Paraskevopoulos Date: Thu, 5 Feb 2026 18:39:39 +0200 Subject: [PATCH] Fixing the influx-db --- modules/application/index.js | 3 ++- modules/exn/index.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/application/index.js b/modules/application/index.js index f32f356..dcd15bc 100644 --- a/modules/application/index.js +++ b/modules/application/index.js @@ -1380,7 +1380,7 @@ module.exports = { try { const credentials = await self.apos.modules.exn.getApplicationInfluxDBCredentials(doc.uuid) - + console.log("Got application influxDBCredentials ",credentials) if (!credentials) { throw self.apos.error('error', "Could not retrieve credentials"); } @@ -1417,6 +1417,7 @@ module.exports = { const interval = req.query.interval || '-30d' const credentials = await self.apos.modules.exn.getApplicationInfluxDBCredentials(doc.uuid) + console.log("Got credentials ",credentials) if (!credentials) { throw self.apos.error('error', "Could not retrieve credentials"); } diff --git a/modules/exn/index.js b/modules/exn/index.js index 200d978..c4a106a 100644 --- a/modules/exn/index.js +++ b/modules/exn/index.js @@ -116,6 +116,10 @@ module.exports = { correlations[context.message.correlation_id]['resolve'](context.message.body) return } + if (context.message.to === "topic://eu.nebulouscloud.app_cluster.influxdb.get.reply") { + correlations[context.message.correlation_id]['resolve'](context.message.body) + return + } if (context.message.correlation_id in correlations) { if (context.message.body.metaData['status'] >= 400) { @@ -137,6 +141,7 @@ module.exports = { context.connection.open_receiver('topic://eu.nebulouscloud.ui.user.get') context.connection.open_receiver('topic://eu.nebulouscloud.ui.app.get') context.connection.open_receiver('topic://eu.nebulouscloud.ontology.bqa.reply') + context.connection.open_receiver('topic://eu.nebulouscloud.app_cluster.influxdb.get.reply') sender_sal_nodecandidate_get = context.connection.open_sender('topic://eu.nebulouscloud.exn.sal.nodecandidate.get'); sender_sal_cloud_get = context.connection.open_sender('topic://eu.nebulouscloud.exn.sal.cloud.get'); @@ -403,13 +408,12 @@ module.exports = { to: sender_app_influxdb.options.target.address, correlation_id: correlation_id, message_annotations: {application: uuid}, - application_properties: {application: uuid} + application_properties: {application: uuid}, + body:"" } const timer = setTimeout(() => { console.warn("InfluxDB Crendetials not retrieved for application = ",uuid) - resolve({ - 'valid':true - }) + resolve(false) }, 7000); console.log("[getApplicationInfluxDBCrendetials] Send ", JSON.stringify( message))