mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Fix get system setting bug when enabled redis cache (#22295)
Fix #22281 In #21621 , `Get[V]` and `Set[V]` has been introduced, so that cache value will be `*Setting`. For memory cache it's OK. But for redis cache, it can only store `string` for the current implementation. This PR revert some of changes of that and just store or return a `string` for system setting.
This commit is contained in:
parent
0f4e1b9ac6
commit
a1c30740bb
5 changed files with 16 additions and 53 deletions
|
@ -153,8 +153,7 @@ func generateEmailAvatarLink(email string, size int, final bool) string {
|
|||
return DefaultAvatarLink()
|
||||
}
|
||||
|
||||
enableFederatedAvatarSetting, _ := system_model.GetSetting(system_model.KeyPictureEnableFederatedAvatar)
|
||||
enableFederatedAvatar := enableFederatedAvatarSetting.GetValueBool()
|
||||
enableFederatedAvatar := system_model.GetSettingBool(system_model.KeyPictureEnableFederatedAvatar)
|
||||
|
||||
var err error
|
||||
if enableFederatedAvatar && system_model.LibravatarService != nil {
|
||||
|
@ -175,9 +174,7 @@ func generateEmailAvatarLink(email string, size int, final bool) string {
|
|||
return urlStr
|
||||
}
|
||||
|
||||
disableGravatarSetting, _ := system_model.GetSetting(system_model.KeyPictureDisableGravatar)
|
||||
|
||||
disableGravatar := disableGravatarSetting.GetValueBool()
|
||||
disableGravatar := system_model.GetSettingBool(system_model.KeyPictureDisableGravatar)
|
||||
if !disableGravatar {
|
||||
// copy GravatarSourceURL, because we will modify its Path.
|
||||
avatarURLCopy := *system_model.GravatarSourceURL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue