Daniel 2024-04-27 13:30:48 +08:00
parent 4af7fef6e4
commit 0312e968a1
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -244,6 +244,10 @@ func searchTreeInFilesystem(rootID string) {
treePath = strings.TrimPrefix(treePath, string(os.PathSeparator))
treePath = strings.TrimPrefix(treePath, boxID)
treePath = filepath.ToSlash(treePath)
if nil == Conf.Box(boxID) {
// 如果笔记本不存在或者已经关闭,则不处理 https://github.com/siyuan-note/siyuan/issues/11149
return
}
tree, err := filesys.LoadTree(boxID, treePath, util.NewLute())
if nil != err {
@ -251,11 +255,6 @@ func searchTreeInFilesystem(rootID string) {
return
}
if nil == Conf.Box(boxID) {
// 如果笔记本不存在或者已经关闭,则不处理 https://github.com/siyuan-note/siyuan/issues/11149
return
}
treenode.IndexBlockTree(tree)
sql.IndexTreeQueue(tree)
logging.LogInfof("reindexed tree by filesystem [rootID=%s]", rootID)