mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 13:17:42 +00:00
edge case for stuck notifications
This commit is contained in:
parent
cc6e862ba6
commit
8c5422af20
1 changed files with 21 additions and 3 deletions
|
@ -175,7 +175,26 @@ func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
|
|||
continue
|
||||
}
|
||||
|
||||
if !thing.IsDeleted() {
|
||||
if thing.IsDeleted() {
|
||||
break
|
||||
}
|
||||
|
||||
things, err := rac.MessageInbox(snc, reddit.WithQuery("after", account.LastMessageID))
|
||||
if err != nil {
|
||||
snc.logger.WithFields(logrus.Fields{
|
||||
"err": err,
|
||||
}).Error("failed to check inbox")
|
||||
return
|
||||
}
|
||||
|
||||
if things.Count == 0 {
|
||||
snc.logger.WithFields(logrus.Fields{
|
||||
"account#username": account.NormalizedUsername(),
|
||||
"thing#id": account.LastMessageID,
|
||||
}).Debug("thing exists, but not in inbox, marking as deleted")
|
||||
break
|
||||
}
|
||||
|
||||
snc.logger.WithFields(logrus.Fields{
|
||||
"account#username": account.NormalizedUsername(),
|
||||
"thing#id": account.LastMessageID,
|
||||
|
@ -183,7 +202,6 @@ func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
|
|||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
snc.logger.WithFields(logrus.Fields{
|
||||
"account#username": account.NormalizedUsername(),
|
||||
|
|
Loading…
Reference in a new issue