mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-11-02 15:31:03 +00:00
backport #26991 Unfortunately, when a system setting hasn't been stored in the database, it cannot be cached. Meanwhile, this PR also uses context cache for push email avatar display which should avoid to read user table via email address again and again. According to my local test, this should reduce dashboard elapsed time from 150ms -> 80ms .
This commit is contained in:
parent
b0a405c5fa
commit
9df573bddc
7 changed files with 62 additions and 84 deletions
|
|
@ -104,7 +104,7 @@ func NewFuncMap() template.FuncMap {
|
|||
return setting.AssetVersion
|
||||
},
|
||||
"DisableGravatar": func(ctx context.Context) bool {
|
||||
return system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar)
|
||||
return system_model.GetSettingWithCacheBool(ctx, system_model.KeyPictureDisableGravatar, setting.GetDefaultDisableGravatar())
|
||||
},
|
||||
"DefaultShowFullName": func() bool {
|
||||
return setting.UI.DefaultShowFullName
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue