feat: customize index max depth

Because some driver's issue may cause infinite loop
This commit is contained in:
Noah Hsu
2023-01-17 17:33:18 +08:00
parent 9c7e451c03
commit 26fe0a7684
7 changed files with 19 additions and 21 deletions

View File

@ -217,10 +217,11 @@ func Update(parent string, objs []model.Obj) {
}
// build index if it's a folder
if objs[i].IsDir() {
dir := path.Join(parent, objs[i].GetName())
err = BuildIndex(ctx,
[]string{path.Join(parent, objs[i].GetName())},
[]string{dir},
conf.SlicesMap[conf.IgnorePaths],
-1, false)
setting.GetInt(conf.MaxIndexDepth, 20)-strings.Count(dir, "/"), false)
if err != nil {
log.Errorf("update search index error while build index: %+v", err)
return