Skip to content

Commit

Permalink
Merge pull request #266 from rambohe-ch/fix-lock-error
Browse files Browse the repository at this point in the history
bugfix: modify the RWMutex lock to Mutex lock
  • Loading branch information
zyjhtangtang authored Apr 19, 2021
2 parents 00a37bc + 7a6f9b6 commit f0b6be1
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 f0b6be1

Please sign in to comment.