get_total_objects_for_query_from_db(): bail if we have any limits set #2586
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Slight continuation from #2571. We should bail if
ep_indexing_lower_limit_object_id
orep_indexing_upper_limit_object_id
is set since we're only looking for the total count from the DB and there's no way to determine that based on the object ID limits.Alternate Designs
N/A.
Possible Drawbacks
It will return a 0, so doesn't exactly fix the initial problem if we run into that with the limit ids.
Verification Process
On a yuge site where it kills the
found_posts
inget_total_objects_for_query()
, pass in--upper-limit-object-id
and expect it to return0
instead of an inaccurate number.Checklist:
Changelog Entry
Fixed: Do not count posts in get_total_objects_for_query_from_db() if any object limit IDs are passed in
Credits
Props @rebeccahum