🎨 导入 Markdown 和 .sy.zip 时增量建立索引 https://github.com/siyuan-note/siyuan/issues/7123

This commit is contained in:
Liang Ding 2023-01-27 11:44:46 +08:00
parent 3432320112
commit ad79dd64b7
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -610,22 +610,14 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
})
reassignIDUpdated(tree)
if err = filesys.WriteTree(tree); nil != err {
return io.EOF
}
indexWriteJSONQueue(tree)
i++
if 0 == i%4 {
util.PushEndlessProgress(fmt.Sprintf(Conf.Language(66), util.ShortPathForBootingDisplay(tree.Path)))
}
return nil
})
if nil != err {
return err
}
IncSync()
FullReindex()
} else { // 导入单个文件
fileName := filepath.Base(localPath)
if !strings.HasSuffix(fileName, ".md") && !strings.HasSuffix(fileName, ".markdown") {
@ -703,13 +695,11 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
})
reassignIDUpdated(tree)
if err = indexWriteJSONQueue(tree); nil != err {
return
}
IncSync()
indexWriteJSONQueue(tree)
}
IncSync()
ReloadUI()
runtime.GC()
return
}