Silence "Web Push subscription expired" errors
These are expected to happen from time to time, nothing to worry about.
This commit is contained in:
parent
f7fbf2ea72
commit
05a0775658
6
user.go
6
user.go
@ -486,13 +486,13 @@ func (net *network) broadcastWebPush(msg *irc.Message) {
|
|||||||
P256dh: sub.Keys.P256DH,
|
P256dh: sub.Keys.P256DH,
|
||||||
},
|
},
|
||||||
}, sub.Keys.VAPID, msg)
|
}, sub.Keys.VAPID, msg)
|
||||||
if err != nil {
|
|
||||||
net.logger.Printf("failed to send Web push notification to endpoint %q: %v", sub.Endpoint, err)
|
|
||||||
}
|
|
||||||
if err == errWebPushSubscriptionExpired {
|
if err == errWebPushSubscriptionExpired {
|
||||||
if err := net.user.srv.db.DeleteWebPushSubscription(ctx, sub.ID); err != nil {
|
if err := net.user.srv.db.DeleteWebPushSubscription(ctx, sub.ID); err != nil {
|
||||||
net.logger.Printf("failed to delete expired Web Push subscription: %v", err)
|
net.logger.Printf("failed to delete expired Web Push subscription: %v", err)
|
||||||
}
|
}
|
||||||
|
net.logger.Debugf("deleted expired Web Push subscription %q", sub.Endpoint)
|
||||||
|
} else if err != nil {
|
||||||
|
net.logger.Printf("failed to send Web push notification to endpoint %q: %v", sub.Endpoint, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user