mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 10:50:15 +01:00
🎨 降低重建索引内存占用 Fix https://github.com/siyuan-note/siyuan/issues/7268
This commit is contained in:
parent
94f623f82a
commit
b9f44309cb
11 changed files with 15 additions and 14 deletions
|
|
@ -506,6 +506,9 @@ func ReloadUI() {
|
|||
|
||||
func FullReindex() {
|
||||
task.PrependTask(task.DatabaseIndexFull, fullReindex)
|
||||
task.AppendTask(task.DatabaseCache, sql.EnableCache)
|
||||
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
||||
task.AppendTask(task.ReloadUI, util.ReloadUI)
|
||||
}
|
||||
|
||||
func fullReindex() {
|
||||
|
|
@ -523,12 +526,9 @@ func fullReindex() {
|
|||
for _, openedBox := range openedBoxes {
|
||||
index(openedBox.ID)
|
||||
}
|
||||
sql.EnableCache()
|
||||
treenode.SaveBlockTree(true)
|
||||
LoadFlashcards()
|
||||
IndexRefs()
|
||||
debug.FreeOSMemory()
|
||||
util.ReloadUI()
|
||||
}
|
||||
|
||||
func ChangeBoxSort(boxIDs []string) {
|
||||
|
|
|
|||
|
|
@ -244,7 +244,6 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
|
|||
|
||||
FullReindex()
|
||||
IncSync()
|
||||
ReloadUI()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -441,7 +441,6 @@ func ImportData(zipPath string) (err error) {
|
|||
|
||||
IncSync()
|
||||
FullReindex()
|
||||
ReloadUI()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -541,7 +541,6 @@ func checkoutRepo(id string) {
|
|||
}
|
||||
|
||||
FullReindex()
|
||||
ReloadUI()
|
||||
|
||||
if syncEnabled {
|
||||
func() {
|
||||
|
|
@ -1028,9 +1027,6 @@ func syncRepo(exit, byHand bool) (err error) {
|
|||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
||||
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
||||
FullReindex()
|
||||
if !exit {
|
||||
ReloadUI()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,9 @@ func SyncData(boot, exit, byHand bool) {
|
|||
func syncData(boot, exit, byHand bool) {
|
||||
defer logging.Recover()
|
||||
|
||||
util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)
|
||||
if !checkSync(boot, exit, byHand) {
|
||||
util.BroadcastByType("main", "syncing", 1, "", nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +120,6 @@ func syncData(boot, exit, byHand bool) {
|
|||
now := util.CurrentTimeMillis()
|
||||
Conf.Sync.Synced = now
|
||||
|
||||
util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)
|
||||
err := syncRepo(exit, byHand)
|
||||
synced := util.Millisecond2Time(Conf.Sync.Synced).Format("2006-01-02 15:04:05") + "\n\n"
|
||||
if nil == err {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue