-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add support for multiple rollup searches. #21755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple rollup searches. #21755
Conversation
💔 Build Failed |
| } | ||
|
|
||
| async function serializeAllFetchParams(fetchParams, searchRequests, serializeFetchParams) { | ||
| const searcRequestsWithFetchParams = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what reviewer let this typo pass?? 😇
|
|
||
| for (let i = 0; i < request.payload.length; i++) { | ||
| const { index, query } = request.payload[i]; | ||
| results.push(await callWithRequest('rollup.search', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using await in a loop blocks the loop iteration until it resolves, right? could we change this a little to use Promise.all instead so that the calls are truly asynchronous?
const results = [];
for (let i = 0; i < request.payload.length; i++) {
const { index, query } = request.payload[i];
results.push(callWithRequest('rollup.search', {
index,
body: query,
}));
}
reply(await Promise.all(results));There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So funny, I went on a walk and realized the same thing, and I knew this comment was waiting for me when I came back...
|
@jen-huang Good catch, fixed. |
💔 Build Failed |
jen-huang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM!
This PR adds support for executing multiple rollup searches in a single request, which enables a dashboard to contain multiple rollup-based visualizations.