···4949 UpdateRev(ctx context.Context, repo, rev string) error
50505151 EnqueueJob(ctx context.Context, repo string) error
5252+ EnqueueJobWithState(ctx context.Context, repo string, state string) error
52535354 PurgeRepo(ctx context.Context, repo string) error
5455}
···486487 })
487488 default:
488489 return fmt.Errorf("invalid op action: %q", op.Action)
490490+ }
491491+ }
492492+493493+ if evt.Prev == nil {
494494+ // The first event for a repo will have a nil prev, we can enqueue the repo as "complete" to avoid fetching the empty repo
495495+ if err := bf.Store.EnqueueJobWithState(ctx, evt.Repo, StateComplete); err != nil {
496496+ return fmt.Errorf("failed to enqueue job with state for repo %q: %w", evt.Repo, err)
489497 }
490498 }
491499