Skip to content

Commit

Permalink
fix RWLock usage
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson committed Dec 4, 2024
1 parent 90fc49a commit a8cc029
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indexer/repofetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,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 {
Expand Down

0 comments on commit a8cc029

Please sign in to comment.