mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (sync): concurrent map read and map write
This commit is contained in:
parent
bfe809d5ab
commit
bb7ea98f02
1 changed files with 2 additions and 2 deletions
|
|
@ -86,9 +86,9 @@ func NewKeyValueStore() KeyValueStore {
|
|||
|
||||
func (this *KeyValueStore) Get(key string) interface{} {
|
||||
var val interface{}
|
||||
this.RLock()
|
||||
this.Lock()
|
||||
val = this.cache[key]
|
||||
this.RUnlock()
|
||||
this.Unlock()
|
||||
return val
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue