1
0

Add empty avatar provider (#149)

Fix lint

Add docs for avatar configuration

Add default avatar provider

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/149
This commit is contained in:
konrad
2020-03-01 21:10:25 +00:00
parent 584e3af237
commit cdd068cdb6
6 changed files with 80 additions and 10 deletions

View File

@ -53,7 +53,7 @@ func (g *Provider) GetAvatar(user *user.User, size int64) ([]byte, string, error
// elaped is alway < 0 so the next check would always succeed.
// To have it make sense, we flip that.
elapsed := time.Until(a.loadedAt) * -1
needsRefetch = elapsed > time.Duration(config.ServiceGravatarExpiration.GetInt64())*time.Second
needsRefetch = elapsed > time.Duration(config.AvatarGravaterExpiration.GetInt64())*time.Second
if needsRefetch {
log.Debugf("Refetching avatar for user %d after %v", user.ID, elapsed)
} else {