fix(search): don't delete virtual folder while update indexes (close #2677)

This commit is contained in:
Noah Hsu
2022-12-11 14:59:58 +08:00
parent 1640f06e13
commit 5043815d48
4 changed files with 11 additions and 2 deletions

View File

@ -201,7 +201,7 @@ func Update(parent string, objs []model.Obj) {
toDelete := old.Difference(now)
toAdd := now.Difference(old)
for i := range nodes {
if toDelete.Contains(nodes[i].Name) {
if toDelete.Contains(nodes[i].Name) && !op.HasStorage(path.Join(parent, nodes[i].Name)) {
log.Debugf("delete index: %s", path.Join(parent, nodes[i].Name))
err = instance.Del(ctx, path.Join(parent, nodes[i].Name))
if err != nil {