this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add method to purge a repo from the backfiller (#549)

authored by

Whyrusleeping and committed by
GitHub
4e5feeb8 efb5f582

+22
+2
backfill/backfill.go
··· 49 49 UpdateRev(ctx context.Context, repo, rev string) error 50 50 51 51 EnqueueJob(ctx context.Context, repo string) error 52 + 53 + PurgeRepo(ctx context.Context, repo string) error 52 54 } 53 55 54 56 // Backfiller is a struct which handles backfilling a repo
+12
backfill/gormstore.go
··· 382 382 383 383 return j.SetRev(ctx, rev) 384 384 } 385 + 386 + func (s *Gormstore) PurgeRepo(ctx context.Context, repo string) error { 387 + if err := s.db.Raw("DELETE FROM gorm_db_jobs WHERE repo = ?", repo).Error; err != nil { 388 + return err 389 + } 390 + 391 + s.lk.Lock() 392 + defer s.lk.Unlock() 393 + delete(s.jobs, repo) 394 + 395 + return nil 396 + }
+8
backfill/memstore.go
··· 144 144 return nil, nil 145 145 } 146 146 147 + func (s *Memstore) PurgeRepo(ctx context.Context, repo string) error { 148 + s.lk.RLock() 149 + defer s.lk.RUnlock() 150 + 151 + delete(s.jobs, repo) 152 + return nil 153 + } 154 + 147 155 func (j *Memjob) Repo() string { 148 156 return j.repo 149 157 }