Skip to content

Commit 74b48d9

Browse files
committed
feedbacks
1 parent 6ac297d commit 74b48d9

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff 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,

x-pack/legacy/plugins/reporting/types.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { EventEmitter } from 'events';
88
import { ResponseObject } from 'hapi';
99
import { Legacy } from 'kibana';
1010
import { CallCluster } from '../../../../src/legacy/core_plugins/elasticsearch';
11+
import { JobStatus } from '../../../plugins/reporting'; // reporting new platform
1112
import { CancellationToken } from './common/cancellation_token';
1213
import { ReportingCore } from './server/core';
1314
import { 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

0 commit comments

Comments
 (0)