mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 21:27:42 +00:00
check if notification was sent too
This commit is contained in:
parent
39ccc1972a
commit
dfae5d6c77
4 changed files with 4 additions and 4 deletions
|
@ -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(),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue