repo-updater: Reduce allocations caused by scheduler syncing
Created by: ryanslade
Our syncScheduler loop has two jobs:
- Ensure all indexable repos are in the scheduler
- Ensure that any uncloned repos in the scheduler are moved to the front of the queue
For 2, we used to fetch ALL cloned repos and send that entire list to the scheduler which would then compare it's internal state and move any repo NOT in the cloned list to the front of the queue. This caused a large number of allocations in repo-updater.
Instead, we now fetch only uncloned repos managed by the scheduler from the database which will be a much smaller list and can then send this to the scheduler instead.