🎨 调整数据库缓存

This commit is contained in:
Liang Ding 2023-02-09 17:18:29 +08:00
parent 6a5617dcc1
commit 19f44148d4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
13 changed files with 17 additions and 22 deletions

View file

@ -506,7 +506,6 @@ func ReloadUI() {
func FullReindex() {
task.AppendTask(task.DatabaseIndexFull, fullReindex)
task.AppendTask(task.DatabaseCache, sql.EnableCache)
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
task.AppendTask(task.ReloadUI, util.ReloadUI)
}
@ -521,7 +520,6 @@ func fullReindex() {
}
treenode.InitBlockTree(true)
sql.DisableCache()
openedBoxes := Conf.GetOpenedBoxes()
for _, openedBox := range openedBoxes {
index(openedBox.ID)

View file

@ -242,6 +242,7 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
return
}
util.ReloadUI()
FullReindex()
IncSync()
return nil
@ -297,9 +298,9 @@ func RollbackNotebookHistory(historyPath string) (err error) {
return
}
util.ReloadUI()
FullReindex()
IncSync()
ReloadUI()
return nil
}

View file

@ -131,9 +131,6 @@ func index(boxID string) {
}
func IndexRefs() {
sql.EnableCache()
defer sql.ClearBlockCache()
start := time.Now()
util.SetBootDetails("Resolving refs...")
util.PushStatusBar(Conf.Language(54))