启动时尝试自动修复损坏的缓存索引数据库

This commit is contained in:
GoEdgeLab
2022-09-07 13:55:36 +08:00
parent edb8848671
commit 390d42c5d9
2 changed files with 44 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ import (
func TestFileListDB_ListLFUItems(t *testing.T) {
var db = caches.NewFileListDB()
err := db.Open(Tea.Root + "/data/cache-db-large.db")
//err := db.Open(Tea.Root + "/data/cache-index/p1/db-0.db")
if err != nil {
t.Fatal(err)
}
@@ -20,6 +21,11 @@ func TestFileListDB_ListLFUItems(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer func() {
_ = db.Close()
}()
hashList, err := db.ListLFUItems(100)
if err != nil {
t.Fatal(err)