Skip to content

Commit 0fc6c46

Browse files
authored
fix: fix Healthcheck blinking (#528)
1 parent 06a5e4e commit 0fc6c46

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/services/api.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,12 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
350350
enable_sampling: enableSampling,
351351
});
352352
}
353-
getHealthcheckInfo(database: string) {
354-
return this.get<HealthCheckAPIResponse>(this.getPath('/viewer/json/healthcheck'), {
355-
tenant: database,
356-
});
353+
getHealthcheckInfo(database: string, {concurrentId}: AxiosOptions = {}) {
354+
return this.get<HealthCheckAPIResponse>(
355+
this.getPath('/viewer/json/healthcheck'),
356+
{tenant: database},
357+
{concurrentId},
358+
);
357359
}
358360
killTablet(id?: string) {
359361
return this.get<string>(this.getPath(`/tablets?KillTabletID=${id}`), {});

src/store/reducers/healthcheckInfo.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const healthcheckInfo: Reducer<IHealthcheckInfoState, IHealthCheckInfoAction> =
4444
};
4545
}
4646
case FETCH_HEALTHCHECK.FAILURE: {
47+
if (action.error?.isCancelled) {
48+
return state;
49+
}
50+
4751
return {
4852
...state,
4953
error: action.error,
@@ -147,7 +151,7 @@ export const selectIssuesStatistics: Selector<
147151

148152
export function getHealthcheckInfo(database: string) {
149153
return createApiRequest({
150-
request: window.api.getHealthcheckInfo(database),
154+
request: window.api.getHealthcheckInfo(database, {concurrentId: 'getHealthcheckInfo'}),
151155
actions: FETCH_HEALTHCHECK,
152156
});
153157
}

0 commit comments

Comments
 (0)