mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17:19 +00:00
Enable caching on assets and avatars (#3376)
* Enable caching on assets and avatars Fixes #3323 * Only set avatar in user BeforeUpdate when there is no avatar set * add error checking after stat * gofmt * Change cache time for avatars to an hour
This commit is contained in:
committed by
Lauris BH
parent
77f8bad2fb
commit
17655cdf1b
@@ -145,7 +145,7 @@ func (u *User) BeforeUpdate() {
|
||||
if len(u.AvatarEmail) == 0 {
|
||||
u.AvatarEmail = u.Email
|
||||
}
|
||||
if len(u.AvatarEmail) > 0 {
|
||||
if len(u.AvatarEmail) > 0 && u.Avatar == "" {
|
||||
u.Avatar = base.HashEmail(u.AvatarEmail)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user