Skip to content
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

Reduce default limit of readinglog API to 100 #9046

Merged

Conversation

cdrini
Copy link
Collaborator

@cdrini cdrini commented Apr 8, 2024

Closes #8852 . The readinglog APIs were fetching with a default of 5000. That's too much for a default, so reduce that to 100. Also add a total numFound field to the response to make pagination easier.

Note this is a BREAKING CHANGE to a public API, but I think it's required for healthy site/solr performance. Also because of the bug in #8852 , it would error if you tried to get a lot of books in one go anyways.

Technical

Testing

Screenshot

Stakeholders

@mheiman

@cdrini cdrini force-pushed the fix/paginate-readinglog-api branch from 1e398ac to ecd88a3 Compare April 8, 2024 17:48
And add numFound field for easier pagination
@cdrini cdrini force-pushed the fix/paginate-readinglog-api branch from ecd88a3 to 9cbe3cc Compare April 8, 2024 17:52
@cdrini cdrini added the On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing label Apr 8, 2024
@cdrini cdrini marked this pull request as ready for review April 8, 2024 18:11
Copy link
Collaborator

@scottbarnes scottbarnes left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just one question about the count for num_found.

openlibrary/plugins/upstream/mybooks.py Show resolved Hide resolved
openlibrary/plugins/upstream/mybooks.py Outdated Show resolved Hide resolved
@scottbarnes scottbarnes added the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Apr 12, 2024
@scottbarnes scottbarnes removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Apr 13, 2024
Copy link
Collaborator

@scottbarnes scottbarnes left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@scottbarnes scottbarnes merged commit 69b903a into internetarchive:master Apr 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading log JSON view errors when too many work IDs passed to solr
2 participants