From 7762c3edb79967d063c6eadf8ef01783b06ee952 Mon Sep 17 00:00:00 2001 From: Mike Tagg Date: Sat, 11 May 2024 10:42:06 -0700 Subject: [PATCH] Grafana api key section commented out temporarily Upon load of the graphscontainer component an event call is made to electron (health request) which calls the mongo fetch function which grabs all the health data stored inside of the individual services databases. Inside of the mongoFetch function there is a call for the grafana api key database. In the microservices portion of the app grafana is not used so there is no key. This was causing an error and preventing data flow. This portion is being commented out temporarily so that more specific controls can be made to differentiate between apps that use docker (and thus grafana) and microservices --- electron/routes/dataHelpers.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/electron/routes/dataHelpers.ts b/electron/routes/dataHelpers.ts index 1cc30747d..211a1f9c3 100644 --- a/electron/routes/dataHelpers.ts +++ b/electron/routes/dataHelpers.ts @@ -35,12 +35,12 @@ const mongoFetch = async ( try { //We are creating models to populate with data for each service const testModel = HealthModelFunc(serviceName); - const grafanaAPIKey = await GrafanaAPIKeyModel.find({}); + // const grafanaAPIKey = await GrafanaAPIKeyModel.find({}); let result = await testModel.aggregate(aggregator); - console.log({result}) - for (let i = 0; i < result.length; i++) { - result[i].token = grafanaAPIKey[0].token; - } + // console.log({result}) + // for (let i = 0; i < result.length; i++) { + // result[i].token = grafanaAPIKey[0].token; + // } result = [{ [serviceName]: result }]; return result; } catch (error) {