check if notification was sent too

This commit is contained in:
Andre Medeiros 2022-01-14 15:29:56 -05:00
parent 39ccc1972a
commit dfae5d6c77
4 changed files with 4 additions and 4 deletions

View file

@ -333,7 +333,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
}
res, err := client.Push(notification)
if err != nil {
if err != nil || !res.Sent() {
_ = nc.statsd.Incr("apns.notification.errors", []string{}, 1)
nc.logger.WithFields(logrus.Fields{
"account#username": account.NormalizedUsername(),

View file

@ -401,7 +401,7 @@ func (sc *subredditsConsumer) Consume(delivery rmq.Delivery) {
}
res, err := client.Push(notification)
if err != nil {
if err != nil || !res.Sent() {
_ = sc.statsd.Incr("apns.notification.errors", []string{}, 1)
sc.logger.WithFields(logrus.Fields{
"subreddit#id": subreddit.ID,

View file

@ -286,7 +286,7 @@ func (tc *trendingConsumer) Consume(delivery rmq.Delivery) {
}
res, err := client.Push(notification)
if err != nil {
if err != nil || !res.Sent() {
_ = tc.statsd.Incr("apns.notification.errors", []string{}, 1)
tc.logger.WithFields(logrus.Fields{
"subreddit#id": subreddit.ID,

View file

@ -281,7 +281,7 @@ func (uc *usersConsumer) Consume(delivery rmq.Delivery) {
}
res, err := client.Push(notification)
if err != nil {
if err != nil || !res.Sent() {
_ = uc.statsd.Incr("apns.notification.errors", []string{}, 1)
uc.logger.WithFields(logrus.Fields{
"user#id": user.ID,