Skip to content

Commit

Permalink
fix Converting circular structure to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabecinha84 committed Jan 4, 2024
1 parent 367f999 commit 53bf08b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions ZelBack/src/services/appsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -10540,9 +10540,10 @@ async function masterSlaveApps() {
let ip = null;
let serverStatus = null;
// eslint-disable-next-line no-await-in-loop
const fdmEUData = await serviceHelper.axiosGet(`https://fdm-fn-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmEUData = await serviceHelper.axiosGet(`https://fdm-fn-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach EU FDM with error: ${error}`);
});
fdmEUData = JSON.parse(fdmEUData);
fdmOk = true;
if (fdmEUData && fdmEUData.length > 0) {
const ipElement = fdmEUData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand All @@ -10553,9 +10554,10 @@ async function masterSlaveApps() {
}
if (!ip || !serverStatus) {
// eslint-disable-next-line no-await-in-loop
const fdmUSAData = await serviceHelper.axiosGet(`https://fdm-usa-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmUSAData = await serviceHelper.axiosGet(`https://fdm-usa-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach USA FDM with error: ${error}`);
});
fdmUSAData = JSON.parse(fdmUSAData);
fdmOk = true;
if (fdmUSAData && fdmUSAData.length > 0) {
const ipElement = fdmUSAData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand All @@ -10567,9 +10569,10 @@ async function masterSlaveApps() {
}
if (!ip || !serverStatus) {
// eslint-disable-next-line no-await-in-loop
const fdmASIAData = await serviceHelper.axiosGet(`https://fdm-sg-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmASIAData = await serviceHelper.axiosGet(`https://fdm-sg-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach ASIA FDM with error: ${error}`);
});
fdmASIAData = JSON.parse(fdmASIAData);
fdmOk = true;
if (fdmASIAData && fdmASIAData.length > 0) {
const ipElement = fdmASIAData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand Down Expand Up @@ -10601,10 +10604,11 @@ async function masterSlaveApps() {
let ip = null;
let serverStatus = null;
// eslint-disable-next-line no-await-in-loop
const fdmEUData = await serviceHelper.axiosGet(`https://fdm-fn-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmEUData = await serviceHelper.axiosGet(`https://fdm-fn-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach EU FDM with error: ${error}`);
});
log.info(`masterSlaveApps: fdmEUData:${JSON.stringify(fdmEUData)}`);
log.info(`masterSlaveApps: fdmEUData:${fdmEUData}`);
fdmEUData = JSON.parse(fdmEUData);
fdmOk = true;
if (fdmEUData && fdmEUData.length > 0) {
const ipElement = fdmEUData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand All @@ -10615,10 +10619,11 @@ async function masterSlaveApps() {
}
if (!ip || !serverStatus) {
// eslint-disable-next-line no-await-in-loop
const fdmUSAData = await serviceHelper.axiosGet(`https://fdm-usa-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmUSAData = await serviceHelper.axiosGet(`https://fdm-usa-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach USA FDM with error: ${error}`);
});
log.info(`masterSlaveApps: fdmUSAData:${JSON.stringify(fdmUSAData)}`);
log.info(`masterSlaveApps: fdmUSAData:${fdmUSAData}`);
fdmUSAData = JSON.parse(fdmUSAData);
fdmOk = true;
if (fdmUSAData && fdmUSAData.length > 0) {
const ipElement = fdmUSAData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand All @@ -10630,10 +10635,11 @@ async function masterSlaveApps() {
}
if (!ip || !serverStatus) {
// eslint-disable-next-line no-await-in-loop
const fdmASIAData = await serviceHelper.axiosGet(`https://fdm-sg-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
let fdmASIAData = await serviceHelper.axiosGet(`https://fdm-sg-1-4.runonflux.io/fluxstatistics?scope=${installedApp.name};json;norefresh`, axiosOptions).catch((error) => {
log.error(`masterSlaveApps: Failed to reach ASIA FDM with error: ${error}`);
});
log.info(`masterSlaveApps: fdmASIAData:${JSON.stringify(fdmASIAData)}`);
log.info(`masterSlaveApps: fdmASIAData:${fdmASIAData}`);
fdmASIAData = JSON.parse(fdmASIAData);
fdmOk = true;
if (fdmASIAData && fdmASIAData.length > 0) {
const ipElement = fdmASIAData.find((element) => element.id === 1 && element.objType === 'Server' && element.field.name === 'svname');
Expand Down

0 comments on commit 53bf08b

Please sign in to comment.