Skip to content

Commit

Permalink
[ML] fix job and datafeed states check, add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jul 22, 2021
1 parent a6e0f92 commit 65dbb89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions x-pack/plugins/ml/server/lib/alerts/jobs_health_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function jobsHealthServiceProvider(

return {
/**
* Gets not started datafeeds and not opened jobs for provided jobs selection.
* Gets not started datafeeds for opened jobs.
* @param jobIds
*/
async getNotStartedDatafeeds(jobIds: string[]): Promise<NotStartedDatafeedResponse | void> {
Expand Down Expand Up @@ -104,10 +104,10 @@ export function jobsHealthServiceProvider(
job_state: jobState,
};
})
.filter(
(datafeedStat) =>
datafeedStat.state !== 'started' || datafeedStat.job_state !== 'opened'
);
.filter((datafeedStat) => {
// Find opened jobs with not started datafeeds
return datafeedStat.job_state === 'opened' && datafeedStat.state !== 'started';
});
}
},
/**
Expand Down

0 comments on commit 65dbb89

Please sign in to comment.