mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
dc4b5accfb
commit
88f716b5d6
7 changed files with 90 additions and 48 deletions
|
|
@ -523,30 +523,6 @@ func genTreeID(tree *parse.Tree) {
|
|||
return
|
||||
}
|
||||
|
||||
func ReindexTree(path string) (err error) {
|
||||
if !strings.HasPrefix(path, "/data/") {
|
||||
return errors.New("path must start with /data/")
|
||||
}
|
||||
|
||||
part := strings.TrimPrefix(path, "/data/")
|
||||
idx := strings.Index(part, "/")
|
||||
if 0 > idx {
|
||||
return errors.New("parse box failed")
|
||||
}
|
||||
box := part[:idx]
|
||||
|
||||
p := strings.TrimPrefix(path, "/data/"+box)
|
||||
tree, err := LoadTree(box, p)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
treenode.ReindexBlockTree(tree)
|
||||
sql.UpsertTreeQueue(tree)
|
||||
sql.WaitForWritingDatabase()
|
||||
return
|
||||
}
|
||||
|
||||
func FullReindex() {
|
||||
util.PushEndlessProgress(Conf.Language(35))
|
||||
WaitForWritingFiles()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue