fix sync: RUnlock of unlocked RWMutex

This commit is contained in:
nikk gitanes
2024-04-10 00:33:15 +03:00
parent 00464fb934
commit f231cd1e3c

View File

@@ -31,8 +31,8 @@ func (v *DBReadCache) CloseDB() {
func (v *DBReadCache) Get(xPath, name string) []byte {
cacheKey := v.makeDataCacheKey(xPath, name)
v.dataCacheMutex.RLock()
defer v.dataCacheMutex.RUnlock()
if data, ok := v.dataCache[cacheKey]; ok {
defer v.dataCacheMutex.RUnlock()
return data
}
v.dataCacheMutex.RUnlock()