文件缓存统计去除过期时间条件

This commit is contained in:
刘祥超
2021-07-08 09:19:41 +08:00
parent 9e418e73bf
commit dbd92368ae

View File

@@ -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()
}