From da4cb33755386b206f19181e69a248051b5820cc Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 1 Apr 2022 10:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=8B=E6=9D=BF=EF=BC=9A=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E6=95=B0=E6=8D=AE=E4=B8=8D=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=E6=89=8D=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/rpc/tasks/cache_task_manager.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/rpc/tasks/cache_task_manager.go b/internal/rpc/tasks/cache_task_manager.go index 87bd078a..aed67e5c 100644 --- a/internal/rpc/tasks/cache_task_manager.go +++ b/internal/rpc/tasks/cache_task_manager.go @@ -82,7 +82,9 @@ func (this *CacheTaskManager) Loop() error { return err } this.locker.Lock() - this.cacheMap[CacheKeyFindAllMetricDataCharts] = value + if len(value) > 0 { + this.cacheMap[CacheKeyFindAllMetricDataCharts] = value + } this.locker.Unlock() } @@ -98,7 +100,9 @@ func (this *CacheTaskManager) Loop() error { var composedKey = CacheKeyFindGlobalTopDomains this.locker.Lock() - this.cacheMap[composedKey] = value + if len(value) > 0 { + this.cacheMap[composedKey] = value + } this.locker.Unlock() } @@ -118,7 +122,9 @@ func (this *CacheTaskManager) Loop() error { return err } this.locker.Lock() - this.cacheMap[composedKey] = value + if len(value) > 0 { + this.cacheMap[composedKey] = value + } this.locker.Unlock() } @@ -140,7 +146,9 @@ func (this *CacheTaskManager) Loop() error { return err } this.locker.Lock() - this.cacheMap[composedKey] = value + if len(value) > 0 { + this.cacheMap[composedKey] = value + } this.locker.Unlock() } }