Skip to content

Commit

Permalink
bugfix: modify the RWMutex lock to Mutex lock
Browse files Browse the repository at this point in the history
  • Loading branch information
rambohe-ch committed Apr 19, 2021
1 parent c996995 commit d5d9273
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/yurthub/storage/disk/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
type diskStorage struct {
baseDir string
keyPendingStatus map[string]struct{}
sync.RWMutex
sync.Mutex
}

// NewDiskStorage creates a storage.Store for caching data into local disk
Expand Down Expand Up @@ -377,8 +377,8 @@ func (ds *diskStorage) Recover(key string) error {
}

func (ds *diskStorage) lockKey(key string) bool {
ds.RLock()
defer ds.RUnlock()
ds.Lock()
defer ds.Unlock()
if _, ok := ds.keyPendingStatus[key]; ok {
return false
}
Expand Down

0 comments on commit d5d9273

Please sign in to comment.