but for real this time

This commit is contained in:
Andre Medeiros 2022-07-13 17:29:40 -04:00
parent 3bdd348d50
commit ceade8fe74

View file

@ -165,16 +165,6 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
return return
} }
defer func(acc *domain.Account) {
if err = nc.accountRepo.Update(nc, acc); err != nil {
nc.logger.Error("failed to update account",
zap.Error(err),
zap.String("account#reddit_account_id", id),
zap.String("account#username", account.NormalizedUsername()),
)
}
}(&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.Add(5 * time.Minute)) { if account.TokenExpiresAt.Before(now.Add(5 * time.Minute)) {
nc.logger.Debug("refreshing reddit token", nc.logger.Debug("refreshing reddit token",