mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 09:30:24 +08:00
看板:只有指标数据不为空时才缓存
This commit is contained in:
@@ -82,7 +82,9 @@ func (this *CacheTaskManager) Loop() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
this.locker.Lock()
|
this.locker.Lock()
|
||||||
|
if len(value) > 0 {
|
||||||
this.cacheMap[CacheKeyFindAllMetricDataCharts] = value
|
this.cacheMap[CacheKeyFindAllMetricDataCharts] = value
|
||||||
|
}
|
||||||
this.locker.Unlock()
|
this.locker.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +100,9 @@ func (this *CacheTaskManager) Loop() error {
|
|||||||
var composedKey = CacheKeyFindGlobalTopDomains
|
var composedKey = CacheKeyFindGlobalTopDomains
|
||||||
|
|
||||||
this.locker.Lock()
|
this.locker.Lock()
|
||||||
|
if len(value) > 0 {
|
||||||
this.cacheMap[composedKey] = value
|
this.cacheMap[composedKey] = value
|
||||||
|
}
|
||||||
this.locker.Unlock()
|
this.locker.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +122,9 @@ func (this *CacheTaskManager) Loop() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
this.locker.Lock()
|
this.locker.Lock()
|
||||||
|
if len(value) > 0 {
|
||||||
this.cacheMap[composedKey] = value
|
this.cacheMap[composedKey] = value
|
||||||
|
}
|
||||||
this.locker.Unlock()
|
this.locker.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,7 +146,9 @@ func (this *CacheTaskManager) Loop() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
this.locker.Lock()
|
this.locker.Lock()
|
||||||
|
if len(value) > 0 {
|
||||||
this.cacheMap[composedKey] = value
|
this.cacheMap[composedKey] = value
|
||||||
|
}
|
||||||
this.locker.Unlock()
|
this.locker.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user