scheduler: Simplify query for uncloned repos (#63681)

Since we removed on-demand cloning, the scheduler is now expected to always contain all repositories. Thus, we no longer need to constrain the set of uncloned repos to a ginormous ID list.

Test plan:

CI still passes.
This commit is contained in:
Erik Seliger 2024-07-10 02:24:32 +02:00 committed by GitHub
parent 8bc8ad27bd
commit eb39e68761
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -326,8 +326,6 @@ func watchSyncer(
// newUnclonedReposManager creates a background routine that will periodically list
// the uncloned repositories on gitserver and update the scheduler with the list.
// It also ensures that if any of our indexable repos are missing from the cloned
// list they will be added for cloning ASAP.
func newUnclonedReposManager(ctx context.Context, logger log.Logger, sched *scheduler.UpdateScheduler, store repos.Store) goroutine.BackgroundRoutine {
return goroutine.NewPeriodicGoroutine(
actor.WithInternalActor(ctx),
@ -339,15 +337,7 @@ func newUnclonedReposManager(ctx context.Context, logger log.Logger, sched *sche
baseRepoStore := database.ReposWith(logger, store)
// Move any repos managed by the scheduler that are uncloned to the front
// of the queue.
managed := sched.ListRepoIDs()
if len(managed) == 0 {
return nil
}
uncloned, err := baseRepoStore.ListMinimalRepos(ctx, database.ReposListOptions{IDs: managed, NoCloned: true})
uncloned, err := baseRepoStore.ListMinimalRepos(ctx, database.ReposListOptions{NoCloned: true})
if err != nil {
return errors.Wrap(err, "failed to fetch list of uncloned repositories")
}