mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
cache/namedmemcache: Fix data race
This commit is contained in:
parent
cc351958e1
commit
3f3187de0f
1 changed files with 0 additions and 5 deletions
5
cache/namedmemcache/named_cache.go
vendored
5
cache/namedmemcache/named_cache.go
vendored
|
@ -68,11 +68,6 @@ func (c *Cache) GetOrCreate(key string, create func() (interface{}, error)) (int
|
||||||
c.nlocker.Lock(key)
|
c.nlocker.Lock(key)
|
||||||
defer c.nlocker.Unlock(key)
|
defer c.nlocker.Unlock(key)
|
||||||
|
|
||||||
// Double check
|
|
||||||
if entry, found := c.cache[key]; found {
|
|
||||||
return entry.value, entry.err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create it.
|
// Create it.
|
||||||
value, err := create()
|
value, err := create()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue