Skip to content

Commit

Permalink
adding constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jgowdyelastic committed Mar 12, 2024
1 parent d0d74c8 commit 584db08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions x-pack/plugins/ml/common/constants/jobs_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export const DEFAULT_REFRESH_INTERVAL_MS = 30000;
export const MINIMUM_REFRESH_INTERVAL_MS = 1000;
export const BLOCKED_JOBS_REFRESH_INTERVAL_MS = 2000;
export const BLOCKED_JOBS_REFRESH_INTERVAL_SLOW_MS = 120000; // 2mins
export const BLOCKED_JOBS_REFRESH_THRESHOLD_MS = 60000; // 1min
export const RESETTING_JOBS_REFRESH_INTERVAL_MS = 1000;
export const PROGRESS_JOBS_REFRESH_INTERVAL_MS = 2000;
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { UpgradeWarning } from '../../../../components/upgrade';
import {
BLOCKED_JOBS_REFRESH_INTERVAL_MS,
BLOCKED_JOBS_REFRESH_INTERVAL_SLOW_MS,
BLOCKED_JOBS_REFRESH_THRESHOLD_MS,
} from '../../../../../../common/constants/jobs_list';
import { JobListMlAnomalyAlertFlyout } from '../../../../../alerting/ml_alerting_flyout';
import { StopDatafeedsConfirmModal } from '../confirm_modals/stop_datafeeds_confirm_modal';
Expand Down Expand Up @@ -401,7 +402,7 @@ export class JobsListView extends Component {

getBlockedJobsRefreshInterval() {
const runningTimeMs = Date.now() - this.state.blockingJobsFirstFoundMs;
if (runningTimeMs > 60000) {
if (runningTimeMs > BLOCKED_JOBS_REFRESH_THRESHOLD_MS) {
// if the jobs have been in a blocked state for more than a minute
// increase the polling interval
return BLOCKED_JOBS_REFRESH_INTERVAL_SLOW_MS;
Expand Down

0 comments on commit 584db08

Please sign in to comment.