Skip to content

Commit

Permalink
Fix stats lock while reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jul 29, 2019
1 parent 0a878e9 commit af14441
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blobstore/lazysaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ func (l *LazySaver) Shutdown() {

// Stats returns stats.
func (l *LazySaver) Stats() LazyStats {
l.statsMu.Lock()
s := l.stats
l.statsMu.Unlock()
l.mu.RLock()
for e := l.cache.Front(); e != nil; e = e.Next() {
s.ItemQueue++
Expand Down

0 comments on commit af14441

Please sign in to comment.