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 5, 2024
1 parent ff209b5 commit 5a7d037
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 @@ -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 {
Expand Down

0 comments on commit 5a7d037

Please sign in to comment.