This commit is contained in:
Liang Ding 2023-01-08 22:47:43 +08:00
parent dc4b5accfb
commit 88f716b5d6
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
7 changed files with 90 additions and 48 deletions

View file

@ -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()