From 8e76e53283f59aa8ac35ebcea2d9b39612843f9c Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 19 Sep 2021 16:11:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E7=BC=93=E5=AD=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9C=80=E5=A4=A7=E6=95=B0=E9=87=8F=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ttlcache/cache.go | 2 +- internal/ttlcache/cache_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ttlcache/cache.go b/internal/ttlcache/cache.go index ce704a7..3ac5249 100644 --- a/internal/ttlcache/cache.go +++ b/internal/ttlcache/cache.go @@ -24,7 +24,7 @@ type Cache struct { func NewCache(opt ...OptionInterface) *Cache { countPieces := 128 - maxItems := 1_000_000 + maxItems := 10_000_000 for _, option := range opt { if option == nil { continue diff --git a/internal/ttlcache/cache_test.go b/internal/ttlcache/cache_test.go index 0ffcf11..02da1f9 100644 --- a/internal/ttlcache/cache_test.go +++ b/internal/ttlcache/cache_test.go @@ -65,6 +65,7 @@ func TestCache_Read(t *testing.T) { for i := 0; i < 10_000_000; i++ { cache.Write("HELLO_WORLD_"+strconv.Itoa(i), i, time.Now().Unix()+int64(i%10240)+1) } + time.Sleep(10 * time.Second) total := 0 for _, piece := range cache.pieces {