fix: don't save search files of balance account (close #1125)

pull/1167/head
Xhofe 2022-05-21 22:12:18 +08:00
parent eb549f2631
commit 6a7eb8b3eb
1 changed files with 4 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/Xhofe/alist/model" "github.com/Xhofe/alist/model"
"github.com/Xhofe/alist/utils" "github.com/Xhofe/alist/utils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"strings"
) )
func KeyCache(path string, account *model.Account) string { func KeyCache(path string, account *model.Account) string {
@ -15,6 +16,9 @@ func KeyCache(path string, account *model.Account) string {
} }
func SaveSearchFiles[T model.ISearchFile](key string, obj []T) { func SaveSearchFiles[T model.ISearchFile](key string, obj []T) {
if strings.Contains(key, ".balance") {
return
}
err := model.DeleteSearchFilesByPath(key) err := model.DeleteSearchFilesByPath(key)
if err != nil { if err != nil {
log.Errorln("failed create search files", err) log.Errorln("failed create search files", err)