Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:zap: 改进数据快照加载性能 https://github.com/siyuan-note/siyuan/issues/6872

Liang Ding24dbb7c092dd
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 315cbc1fde..4a6b375c10 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -76,7 +76,7 @@ func GetRepoSnapshots(page int) (ret []*Snapshot, pageCount, totalCount int, err
return
}
- logs, pageCount, totalCount, err := repo.GetIndexLogs(page, 16)
+ logs, pageCount, totalCount, err := repo.GetIndexLogs(page, 32)
if nil != err {
if dejavu.ErrNotFoundIndex == err {
logs = []*dejavu.Log{}
@@ -98,6 +98,7 @@ func GetRepoSnapshots(page int) (ret []*Snapshot, pageCount, totalCount int, err
func buildSnapshots(logs []*dejavu.Log) (ret []*Snapshot) {
for _, l := range logs {
typesCount := statTypesByPath(l.Files)
+ l.Files = nil // 置空,否则返回前端数据量太大
ret = append(ret, &Snapshot{
Log: l,
TypesCount: typesCount,
@@ -936,7 +937,7 @@ func subscribeEvents() {
indexWalkDataCount := 0
eventbus.Subscribe(eventbus.EvtIndexWalkData, func(context map[string]interface{}, path string) {
msg := fmt.Sprintf(Conf.Language(158), filepath.Base(path))
- if 0 == indexWalkDataCount%512 {
+ if 0 == indexWalkDataCount%1024 {
util.SetBootDetails(msg)
util.ContextPushMsg(context, msg)
}
@@ -950,7 +951,7 @@ func subscribeEvents() {
getLatestFileCount := 0
eventbus.Subscribe(eventbus.EvtIndexGetLatestFile, func(context map[string]interface{}, id string) {
msg := fmt.Sprintf(Conf.Language(159), id[:7])
- if 0 == getLatestFileCount%512 {
+ if 0 == getLatestFileCount%1024 {
util.SetBootDetails(msg)
util.ContextPushMsg(context, msg)
}
@@ -979,7 +980,7 @@ func subscribeEvents() {
coWalkDataCount := 0
eventbus.Subscribe(eventbus.EvtCheckoutWalkData, func(context map[string]interface{}, path string) {
msg := fmt.Sprintf(Conf.Language(161), filepath.Base(path))
- if 0 == coWalkDataCount%512 {
+ if 0 == coWalkDataCount%1024 {
util.SetBootDetails(msg)
util.ContextPushMsg(context, msg)
}
@@ -1011,7 +1012,7 @@ func subscribeEvents() {
eventbus.Subscribe(eventbus.EvtCheckoutRemoveFile, func(context map[string]interface{}, path string) {
msg := fmt.Sprintf(Conf.Language(163), filepath.Base(path))
util.IncBootProgress(bootProgressPart, msg)
- if 0 == coRemoveFileCount%512 {
+ if 0 == coRemoveFileCount%1024 {
util.ContextPushMsg(context, msg)
}
coRemoveFileCount++