diff --git a/indexer/repofetch.go b/indexer/repofetch.go index b5f776ed..2c1dc7e1 100644 --- a/indexer/repofetch.go +++ b/indexer/repofetch.go @@ -50,8 +50,8 @@ func (rf *RepoFetcher) GetLimiter(pdsID uint) *rate.Limiter { } func (rf *RepoFetcher) GetOrCreateLimiter(pdsID uint, pdsrate float64) *rate.Limiter { - rf.LimitMux.RLock() - defer rf.LimitMux.RUnlock() + rf.LimitMux.Lock() + defer rf.LimitMux.Unlock() lim, ok := rf.Limiters[pdsID] if !ok {