[ML] Fixing issue with historical job audit messages (#21718)

This commit is contained in:
James Gowdy 2018-08-07 14:11:08 +01:00 committed by GitHub
parent 8ccafd073b
commit ae0f49658a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,8 +20,8 @@ export function jobAuditMessagesProvider(callWithRequest) {
let gte = null;
if (jobId !== undefined && from === undefined) {
const jobs = await callWithRequest('ml.jobs', { jobId });
if (jobs.length) {
gte = moment(jobs[0].create_time).valueOf();
if (jobs.count > 0 && jobs.jobs !== undefined) {
gte = moment(jobs.jobs[0].create_time).valueOf();
}
} else if (from !== undefined) {
gte = `now-${from}`;