From dbd92368ae43a8b414ff73842fa15260ede226a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 8 Jul 2021 09:19:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=BC=93=E5=AD=98=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=8E=BB=E9=99=A4=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/caches/list_file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/caches/list_file.go b/internal/caches/list_file.go index bcbbe8b..b42d572 100644 --- a/internal/caches/list_file.go +++ b/internal/caches/list_file.go @@ -115,7 +115,7 @@ func (this *FileList) Init() error { return err } - this.statStmt, err = this.db.Prepare(`SELECT COUNT(*), IFNULL(SUM(headerSize+bodySize+metaSize), 0), IFNULL(SUM(headerSize+bodySize), 0) FROM "` + this.itemsTableName + `" WHERE expiredAt>?`) + this.statStmt, err = this.db.Prepare(`SELECT COUNT(*), IFNULL(SUM(headerSize+bodySize+metaSize), 0), IFNULL(SUM(headerSize+bodySize), 0) FROM "` + this.itemsTableName + `"`) if err != nil { return err } @@ -297,7 +297,7 @@ func (this *FileList) Stat(check func(hash string) bool) (*Stat, error) { } // 这里不设置过期时间、不使用 check 函数,目的是让查询更快速一些 - row := this.statStmt.QueryRow(time.Now().Unix()) + row := this.statStmt.QueryRow() if row.Err() != nil { return nil, row.Err() }