🎨 导入 Markdown 和 .sy.zip
时增量建立索引 https://github.com/siyuan-note/siyuan/issues/7123
This commit is contained in:
parent
3432320112
commit
ad79dd64b7
1 changed files with 4 additions and 14 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue