feat: search api

This commit is contained in:
Xhofe
2022-04-08 22:03:26 +08:00
parent 6591af58ea
commit a73a40133d
5 changed files with 44 additions and 1 deletions

View File

@ -37,7 +37,9 @@ func SaveSearchFiles[T model.ISearchFile](key string, obj []T) {
func SetCache[T model.ISearchFile](path string, obj []T, account *model.Account) error {
key := KeyCache(path, account)
go SaveSearchFiles(key, obj)
if conf.GetBool("enable search") {
go SaveSearchFiles(key, obj)
}
return conf.Cache.Set(conf.Ctx, key, obj, nil)
}