File tree Expand file tree Collapse file tree
x-pack/legacy/plugins/reporting Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -285,13 +285,10 @@ export class Worker extends events.EventEmitter {
285285 const completedTime = moment ( ) . toISOString ( ) ;
286286 const docOutput = this . _formatOutput ( output ) ;
287287
288- let status ;
289- if ( output && output . warnings && output . warnings . length > 0 ) {
290- status = constants . JOB_STATUS_WARNINGS ;
291- } else {
292- status = constants . JOB_STATUS_COMPLETED ;
293- }
294-
288+ const status =
289+ output && output . warnings && output . warnings . length > 0
290+ ? constants . JOB_STATUS_WARNINGS
291+ : constants . JOB_STATUS_COMPLETED ;
295292 const doc = {
296293 status,
297294 completed_at : completedTime ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { EventEmitter } from 'events';
88import { ResponseObject } from 'hapi' ;
99import { Legacy } from 'kibana' ;
1010import { CallCluster } from '../../../../src/legacy/core_plugins/elasticsearch' ;
11+ import { JobStatus } from '../../../plugins/reporting' ; // reporting new platform
1112import { CancellationToken } from './common/cancellation_token' ;
1213import { ReportingCore } from './server/core' ;
1314import { LevelLogger } from './server/lib/level_logger' ;
@@ -150,7 +151,7 @@ export interface JobSource<JobParamsType> {
150151 jobtype : string ;
151152 output : JobDocOutput ;
152153 payload : JobDocPayload < JobParamsType > ;
153- status : string ; // completed, failed, etc
154+ status : JobStatus ;
154155 } ;
155156}
156157
You can’t perform that action at this time.
0 commit comments