From 117bcaaf0a78fbfb89a04c84ee4ce2dc532dc792 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sat, 12 Jun 2021 10:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=85=E5=AD=98=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=B2=A1=E6=9C=89init()=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/storage_memory.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/caches/storage_memory.go b/internal/caches/storage_memory.go index a20435c..922429e 100644 --- a/internal/caches/storage_memory.go +++ b/internal/caches/storage_memory.go @@ -46,6 +46,8 @@ func NewMemoryStorage(policy *serverconfigs.HTTPCachePolicy) *MemoryStorage { // Init 初始化 func (this *MemoryStorage) Init() error { + _ = this.list.Init() + this.list.OnAdd(func(item *Item) { atomic.AddInt64(&this.totalSize, item.TotalSize()) })