mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +00:00
remove retry logic with token
This commit is contained in:
parent
0262133ce8
commit
fdfa447435
1 changed files with 0 additions and 10 deletions
|
@ -196,9 +196,6 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
retried := false
|
|
||||||
|
|
||||||
refreshToken:
|
|
||||||
rac := nc.reddit.NewAuthenticatedClient(account.RefreshToken, account.AccessToken)
|
rac := nc.reddit.NewAuthenticatedClient(account.RefreshToken, account.AccessToken)
|
||||||
if account.ExpiresAt < int64(now) {
|
if account.ExpiresAt < int64(now) {
|
||||||
nc.logger.WithFields(logrus.Fields{
|
nc.logger.WithFields(logrus.Fields{
|
||||||
|
@ -251,13 +248,6 @@ refreshToken:
|
||||||
msgs, err := rac.MessageInbox(account.LastMessageID)
|
msgs, err := rac.MessageInbox(account.LastMessageID)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Check if maybe we need to refresh the token.
|
|
||||||
if !retried {
|
|
||||||
retried = true
|
|
||||||
account.ExpiresAt = 0
|
|
||||||
goto refreshToken
|
|
||||||
}
|
|
||||||
|
|
||||||
nc.logger.WithFields(logrus.Fields{
|
nc.logger.WithFields(logrus.Fields{
|
||||||
"accountID": id,
|
"accountID": id,
|
||||||
"err": err,
|
"err": err,
|
||||||
|
|
Loading…
Reference in a new issue