Skip to content

Commit

Permalink
Cache nil values too
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Samylkin committed Mar 22, 2017
1 parent 9913c08 commit d0c6d17
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions config/cache_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ func (p *cachedProvider) Get(key string) Value {
}

v := p.Provider.Get(key)
if v.HasValue() {
p.Lock()
p.cache[key] = v
p.Unlock()
}
p.Lock()
p.cache[key] = v
p.Unlock()

return v
}
Expand Down

0 comments on commit d0c6d17

Please sign in to comment.