🎨 自动校验索引时排除非 id 格式的 .sy 文件 Fix https://github.com/siyuan-note/siyuan/issues/7111

This commit is contained in:
Liang Ding 2023-01-18 13:58:03 +08:00
parent 519f015498
commit c87bb94a60
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 23 additions and 0 deletions

View file

@ -1244,6 +1244,11 @@ func autoFixIndex() {
return
}
if isCheckoutRepo {
logging.LogInfof("skip check index caused by checkout repo")
return
}
if util.IsMutexLocked(&autoFixLock) {
return
}
@ -1286,6 +1291,12 @@ func autoFixIndex() {
break
}
id := path.Base(p)
id = strings.TrimSuffix(id, ".sy")
if !ast.IsNodeIDPattern(id) {
continue
}
reindexTreeByPath(box.ID, p, i, size)
}
}