mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
cache/namedmemcache: Fix data race
This commit is contained in:
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)
|
||||
defer c.nlocker.Unlock(key)
|
||||
|
||||
// Double check
|
||||
if entry, found := c.cache[key]; found {
|
||||
return entry.value, entry.err
|
||||
}
|
||||
|
||||
// Create it.
|
||||
value, err := create()
|
||||
|
||||
|
Reference in New Issue
Block a user