Tweak stuck notifications a bit mroe

This commit is contained in:
Andre Medeiros 2022-05-19 13:02:16 -04:00
parent af592c446f
commit adbaeb9e54

View file

@ -179,7 +179,11 @@ func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
break break
} }
things, err := rac.MessageInbox(snc, reddit.WithQuery("after", account.LastMessageID)) if kind == "t4" {
return
}
sthings, err := rac.MessageInbox(snc)
if err != nil { if err != nil {
snc.logger.WithFields(logrus.Fields{ snc.logger.WithFields(logrus.Fields{
"err": err, "err": err,
@ -187,7 +191,14 @@ func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
return return
} }
if things.Count == 0 { found := false
for _, sthing := range sthings.Children {
if sthing.FullName() == account.LastMessageID {
found = true
}
}
if !found {
snc.logger.WithFields(logrus.Fields{ snc.logger.WithFields(logrus.Fields{
"account#username": account.NormalizedUsername(), "account#username": account.NormalizedUsername(),
"thing#id": account.LastMessageID, "thing#id": account.LastMessageID,