Skip to content

Commit

Permalink
🎨 Improve box ref indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 11, 2024
1 parent fd22bbb commit 63839cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/model/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,15 @@ func unindex(boxID string) {
}

func (box *Box) Index() {
task.AppendTask(task.DatabaseIndexRef, removeBoxRefs, box.ID)
task.AppendTask(task.DatabaseIndex, index, box.ID)
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
}

func removeBoxRefs(boxID string) {
sql.DeleteBoxRefsQueue(boxID)
}

func index(boxID string) {
box := Conf.Box(boxID)
if nil == box {
Expand Down Expand Up @@ -219,8 +224,6 @@ func IndexRefs() {
luteEngine := util.NewLute()
boxes := Conf.GetOpenedBoxes()
for _, box := range boxes {
sql.DeleteBoxRefsQueue(box.ID)

pages := pagedPaths(filepath.Join(util.DataDir, box.ID), 32)
for _, paths := range pages {
for _, treeAbsPath := range paths {
Expand Down

0 comments on commit 63839cb

Please sign in to comment.