|
@@ -44,20 +44,12 @@ func RefreshBacklink(id string) {
|
|
|
|
|
|
func refreshRefsByDefID(defID string) {
|
|
|
refs := sql.QueryRefsByDefID(defID, false)
|
|
|
- trees := map[string]*parse.Tree{}
|
|
|
+ var rootIDs []string
|
|
|
for _, ref := range refs {
|
|
|
- tree := trees[ref.RootID]
|
|
|
- if nil != tree {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- var loadErr error
|
|
|
- tree, loadErr = LoadTreeByBlockID(ref.RootID)
|
|
|
- if nil != loadErr {
|
|
|
- logging.LogErrorf("refresh tree refs failed: %s", loadErr)
|
|
|
- continue
|
|
|
- }
|
|
|
- trees[ref.RootID] = tree
|
|
|
+ rootIDs = append(rootIDs, ref.RootID)
|
|
|
+ }
|
|
|
+ trees := filesys.LoadTrees(rootIDs)
|
|
|
+ for _, tree := range trees {
|
|
|
sql.UpdateRefsTreeQueue(tree)
|
|
|
}
|
|
|
}
|