From 7a6f9b6d8d1aea7405bb00a41392dd5fb9245a93 Mon Sep 17 00:00:00 2001 From: rambohe-ch Date: Mon, 19 Apr 2021 17:25:12 +0800 Subject: [PATCH] bugfix: modify the RWMutex lock to Mutex lock --- pkg/yurthub/storage/disk/storage.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/yurthub/storage/disk/storage.go b/pkg/yurthub/storage/disk/storage.go index d9f1e88834a..5c151b848b5 100644 --- a/pkg/yurthub/storage/disk/storage.go +++ b/pkg/yurthub/storage/disk/storage.go @@ -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 @@ -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 }