From 5b93b286909fa6cedd4de0950ff79fc35e6daacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Fri, 13 Oct 2023 08:28:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E7=8E=87=E7=BB=9F=E8=AE=A1=E9=87=87=E6=A0=B7=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E5=92=8C=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/utils/cachehits/stat.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/utils/cachehits/stat.go b/internal/utils/cachehits/stat.go index 0c907d3..ca37908 100644 --- a/internal/utils/cachehits/stat.go +++ b/internal/utils/cachehits/stat.go @@ -11,7 +11,7 @@ import ( "time" ) -const countSamples = 10_000 +const countSamples = 100_000 type Item struct { countHits uint64 @@ -138,7 +138,7 @@ func (this *Stat) IsGood(category string) bool { return true } - if item.countCached > countSamples { + if item.countCached > countSamples && item.timestamp < fasttime.Now().Unix()-600 /** 10 minutes ago **/ { var isGood = item.countHits*100/item.countCached >= this.goodRatio if isGood { item.isGood = true