mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 03:37:43 +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,13 +175,31 @@ 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, returning")
|
||||
return
|
||||
}).Debug("thing exists, but not in inbox, marking as deleted")
|
||||
break
|
||||
}
|
||||
|
||||
snc.logger.WithFields(logrus.Fields{
|
||||
"account#username": account.NormalizedUsername(),
|
||||
"thing#id": account.LastMessageID,
|
||||
}).Debug("thing exists, returning")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue