Skip to content

Commit

Permalink
[chore] Improve request cancelation handling in vis embeddable (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed May 7, 2020
1 parent c4ab557 commit 74cd120
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,14 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
this.abortController.abort();
}
this.abortController = new AbortController();
const abortController = this.abortController;
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

0 comments on commit 74cd120

Please sign in to comment.