Skip to content

run count and search concurrently, but don't wait for count to be done #88

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

Merged
merged 2 commits into from
Mar 25, 2022

Conversation

philvarner
Copy link
Collaborator

Related Issue(s):

Description:

Previously, the count and search ES requests were run sequentially, so every search request was delayed for as long as it took to get the complete count of matches. This is an optional field in the Context Extension, and is generally not worth waiting on.

Now, the code creates tasks for both the count and search, and only awaits the search task. If the count task isn't completed by the time the search is finished and its results serialized to Items, the count is ignored and the items. are returned.

Also note that we do not cancel the count task, so that it will complete and the ES cache will be populated with the results for the next similar query.

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable, and docs build successfully (run make docs)
  • Changes are added to the changelog

@philvarner
Copy link
Collaborator Author

actions aren't running, but this passed locally (though it also passed locally before I made the change). We'll see in main if there are any problems.

@philvarner philvarner merged commit b3bec46 into main Mar 25, 2022
@philvarner philvarner deleted the pv/run-count-and-search-concurrently branch March 25, 2022 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants