mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +00:00
add a bit of breathing room for token refresh
This commit is contained in:
parent
1db3f6cbbb
commit
4f34e3927b
1 changed files with 1 additions and 1 deletions
|
@ -178,7 +178,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
|
||||||
}(&account)
|
}(&account)
|
||||||
|
|
||||||
rac := nc.reddit.NewAuthenticatedClient(account.AccountID, account.RefreshToken, account.AccessToken)
|
rac := nc.reddit.NewAuthenticatedClient(account.AccountID, account.RefreshToken, account.AccessToken)
|
||||||
if account.TokenExpiresAt.Before(now) {
|
if account.TokenExpiresAt.Before(now.Add(1 * time.Minute)) {
|
||||||
nc.logger.Debug("refreshing reddit token",
|
nc.logger.Debug("refreshing reddit token",
|
||||||
zap.Int64("account#id", id),
|
zap.Int64("account#id", id),
|
||||||
zap.String("account#username", account.NormalizedUsername()),
|
zap.String("account#username", account.NormalizedUsername()),
|
||||||
|
|
Loading…
Reference in a new issue