mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
Tweak stuck notifications a bit mroe
This commit is contained in:
parent
af592c446f
commit
adbaeb9e54
1 changed files with 13 additions and 2 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue