Skip to content

Commit

Permalink
Update jobs executors to use content stream instead of returning repo…
Browse files Browse the repository at this point in the history
…rt contents
  • Loading branch information
dokmic committed Aug 4, 2021
1 parent 48b2937 commit 7e3a449
Show file tree
Hide file tree
Showing 20 changed files with 322 additions and 211 deletions.
8 changes: 5 additions & 3 deletions x-pack/plugins/reporting/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface ReportDocumentHead {
_primary_term: number;
}

export interface TaskRunResult {
export interface ReportOutput {
content_type: string | null;
content: string | null;
size: number;
Expand All @@ -53,6 +53,8 @@ export interface TaskRunResult {
warnings?: string[];
}

export type TaskRunResult = Omit<ReportOutput, 'content'>;

export interface ReportSource {
/*
* Required fields: populated in enqueue_job when the request comes in to
Expand All @@ -73,7 +75,7 @@ export interface ReportSource {
/*
* `output` is only populated if the report job is completed or failed.
*/
output: TaskRunResult | null;
output: ReportOutput | null;

/*
* Optional fields: populated when the job is claimed to execute, and after
Expand Down Expand Up @@ -127,7 +129,7 @@ export type JobStatus =
*/
interface ReportSimple extends Omit<ReportSource, 'payload' | 'output'> {
payload: Omit<ReportSource['payload'], 'headers'>;
output?: Omit<TaskRunResult, 'content'>; // is undefined for report jobs that are not completed
output?: Omit<ReportOutput, 'content'>; // is undefined for report jobs that are not completed
}

/*
Expand Down
Loading

0 comments on commit 7e3a449

Please sign in to comment.