Skip to content

Commit

Permalink
Merge branch 'release/v3.17.5' into 1055-rm-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Shugaba-Wuta authored Apr 3, 2024
2 parents 176f583 + 103d5b2 commit 986322e
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/src/services/models/explorer/createAppModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,23 @@ function createAppModel(appConfig: IAppInitialConfig) {
if (!appId) {
setModelDefaultAppConfigData();
}

// fetch project params now and update every 30s
fetchProjectParamsAndUpdateState();
setInterval(fetchProjectParamsAndUpdateState, 30000);

const liveUpdateState = model.getState()?.config?.liveUpdate;

if (liveUpdateState?.enabled) {
liveUpdateInstance = new LiveUpdateService(
appName,
updateData,
liveUpdateState.delay,
);
}
}

function fetchProjectParamsAndUpdateState() {
projectsService
.getProjectParams(['metric'])
.call()
Expand All @@ -564,15 +581,6 @@ function createAppModel(appConfig: IAppInitialConfig) {
},
});
});
const liveUpdateState = model.getState()?.config?.liveUpdate;

if (liveUpdateState?.enabled) {
liveUpdateInstance = new LiveUpdateService(
appName,
updateData,
liveUpdateState.delay,
);
}
}

function updateData(newData: ISequence<IMetricTrace>[]): void {
Expand Down

0 comments on commit 986322e

Please sign in to comment.