Skip to content

Commit

Permalink
adding delayed refresh back in
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Aug 11, 2021
1 parent c78d183 commit 115ad46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions x-pack/plugins/ml/common/constants/jobs_list.ts
Expand Up @@ -8,4 +8,5 @@
export const DEFAULT_REFRESH_INTERVAL_MS = 30000;
export const MINIMUM_REFRESH_INTERVAL_MS = 1000;
export const DELETING_JOBS_REFRESH_INTERVAL_MS = 2000;
export const RESETTING_JOBS_REFRESH_INTERVAL_MS = 1000;
export const PROGRESS_JOBS_REFRESH_INTERVAL_MS = 2000;
Expand Up @@ -21,6 +21,7 @@ import {

import { resetJobs } from '../utils';
import type { MlSummaryJob } from '../../../../../../common/types/anomaly_detection_jobs';
import { RESETTING_JOBS_REFRESH_INTERVAL_MS } from '../../../../../../common/constants/jobs_list';
import { OpenJobsWarningCallout } from './open_jobs_warning_callout';

type ShowFunc = (jobs: MlSummaryJob[]) => void;
Expand Down Expand Up @@ -63,7 +64,9 @@ export const ResetJobModal: FC<Props> = ({ setShowFunction, unsetShowFunction, r
setResetting(true);
await resetJobs(jobIds);
closeModal();
refreshJobs();
setTimeout(() => {
refreshJobs();
}, RESETTING_JOBS_REFRESH_INTERVAL_MS);
}, [jobIds, refreshJobs]);

if (modalVisible === false || jobIds.length === 0) {
Expand Down

0 comments on commit 115ad46

Please sign in to comment.