mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
⚡ Improve database group view performance https://github.com/siyuan-note/siyuan/issues/15811
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
9a15b466f3
commit
de19d69f99
1 changed files with 2 additions and 2 deletions
|
@ -97,14 +97,14 @@ func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView,
|
||||||
if isGroupByDate(view) {
|
if isGroupByDate(view) {
|
||||||
createdDate := time.UnixMilli(view.GroupCreated).Format("2006-01-02")
|
createdDate := time.UnixMilli(view.GroupCreated).Format("2006-01-02")
|
||||||
if time.Now().Format("2006-01-02") != createdDate {
|
if time.Now().Format("2006-01-02") != createdDate {
|
||||||
regenAttrViewGroups(attrView)
|
genAttrViewGroups(view, attrView) // 仅重新生成一个视图的分组以提升性能
|
||||||
av.SaveAttributeView(attrView)
|
av.SaveAttributeView(attrView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果是按模板分组则需要重新生成分组
|
// 如果是按模板分组则需要重新生成分组
|
||||||
if isGroupByTemplate(attrView, view) {
|
if isGroupByTemplate(attrView, view) {
|
||||||
regenAttrViewGroups(attrView)
|
genAttrViewGroups(view, attrView) // 仅重新生成一个视图的分组以提升性能
|
||||||
av.SaveAttributeView(attrView)
|
av.SaveAttributeView(attrView)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue