Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mkobetic committed Aug 28, 2023
1 parent ef28a09 commit 4fc14b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ratelimiter/buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ func (b *Buckets) deleteExpired(expiresAfter time.Duration) {
// Use RLock to iterate over the map
// to allow concurrent reads
b.mutex.RLock()
defer b.mutex.RUnlock()
var expired []string
for bucket, entry := range b.buckets {
if time.Since(entry.lastSeen) > expiresAfter {
expired = append(expired, bucket)
}
}
b.mutex.RUnlock()
if len(expired) == 0 {
return
}
Expand Down

0 comments on commit 4fc14b3

Please sign in to comment.