mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Clean code
This commit is contained in:
parent
9a72ef1472
commit
0f2e044c7e
3 changed files with 4 additions and 4 deletions
|
|
@ -690,7 +690,7 @@ func fullReindex() {
|
||||||
sql.IndexIgnoreCached = false
|
sql.IndexIgnoreCached = false
|
||||||
openedBoxes := Conf.GetOpenedBoxes()
|
openedBoxes := Conf.GetOpenedBoxes()
|
||||||
for _, openedBox := range openedBoxes {
|
for _, openedBox := range openedBoxes {
|
||||||
index(openedBox.ID)
|
indexBox(openedBox.ID)
|
||||||
}
|
}
|
||||||
LoadFlashcards()
|
LoadFlashcards()
|
||||||
debug.FreeOSMemory()
|
debug.FreeOSMemory()
|
||||||
|
|
|
||||||
|
|
@ -870,7 +870,7 @@ func InitBoxes() {
|
||||||
box.UpdateHistoryGenerated() // 初始化历史生成时间为当前时间
|
box.UpdateHistoryGenerated() // 初始化历史生成时间为当前时间
|
||||||
|
|
||||||
if !initialized {
|
if !initialized {
|
||||||
index(box.ID)
|
indexBox(box.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ func unindex(boxID string) {
|
||||||
|
|
||||||
func (box *Box) Index() {
|
func (box *Box) Index() {
|
||||||
task.AppendTask(task.DatabaseIndexRef, removeBoxRefs, box.ID)
|
task.AppendTask(task.DatabaseIndexRef, removeBoxRefs, box.ID)
|
||||||
task.AppendTask(task.DatabaseIndex, index, box.ID)
|
task.AppendTask(task.DatabaseIndex, indexBox, box.ID)
|
||||||
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
||||||
go func() {
|
go func() {
|
||||||
sql.FlushQueue()
|
sql.FlushQueue()
|
||||||
|
|
@ -132,7 +132,7 @@ func removeBoxRefs(boxID string) {
|
||||||
sql.DeleteBoxRefsQueue(boxID)
|
sql.DeleteBoxRefsQueue(boxID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func index(boxID string) {
|
func indexBox(boxID string) {
|
||||||
box := Conf.Box(boxID)
|
box := Conf.Box(boxID)
|
||||||
if nil == box {
|
if nil == box {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue