WIP: Fix limit not applied to count query
What does this MR do?
Fix limit not applied to count query
For API pagination (projects endpoint), we changed to order of calls so
that paginate(..)
comes last. Unfortunately,
BatchCountService#refresh_cache
also iterates the list of projects
which results in a query that doesn't have a limit applied at all.
BatchCountService
: https://gitlab.com/gitlab-org/gitlab/blob/ab/fix-offset-pagination/app/services/projects/batch_count_service.rb#L13
Edited by Andreas Brandl