Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,14 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
this.abortController.abort();
}
this.abortController = new AbortController();
const abortController = this.abortController;
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why creating local variable ? if we have it lets use it everywhere, but without it this can be a one line PR.

Copy link
Copy Markdown
Contributor Author

@Dosant Dosant May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local variable here is needed as a reference to previous abortController instance.
when await buildPipeline is finished, in case it was aborted, this.abortController would be a reference from next request

this.expression = await buildPipeline(this.vis, {
timefilter: this.timefilter,
timeRange: this.timeRange,
abortSignal: this.abortController!.signal,
});

if (this.handler) {
if (this.handler && !abortController.signal.aborted) {
this.handler.update(this.expression, expressionParams);
}
}
Expand Down