From 3f2053c63f449115a5e038c1a95f241a7032be00 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 19 May 2021 22:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=BC=93=E5=AD=98=E7=BB=9F=E8=AE=A1=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/caches/list_file.go b/internal/caches/list_file.go index f6e0fe3..4405e09 100644 --- a/internal/caches/list_file.go +++ b/internal/caches/list_file.go @@ -230,7 +230,7 @@ func (this *FileList) CleanAll() error { func (this *FileList) Stat(check func(hash string) bool) (*Stat, error) { // 这里不设置过期时间、不使用 check 函数,目的是让查询更快速一些 - row := this.db.QueryRow("SELECT COUNT(*), SUM(headerSize+bodySize+metaSize), SUM(headerSize+bodySize) FROM cacheItems") + row := this.db.QueryRow("SELECT COUNT(*), IFNULL(SUM(headerSize+bodySize+metaSize), 0), IFNULL(SUM(headerSize+bodySize), 0) FROM cacheItems") if row.Err() != nil { return nil, row.Err() }