Просмотр исходного кода

Set default TTL for web push to the cache duration

nimbleghost 2 лет назад
Родитель
Сommit
4704b2a0e4
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      server/server_web_push.go

+ 1 - 0
server/server_web_push.go

@@ -116,6 +116,7 @@ func (s *Server) sendWebPushNotification(message []byte, sub *webPushSubscriptio
 		VAPIDPublicKey:  s.config.WebPushPublicKey,
 		VAPIDPrivateKey: s.config.WebPushPrivateKey,
 		Urgency:         webpush.UrgencyHigh, // iOS requires this to ensure delivery
+		TTL:             int(s.config.CacheDuration.Seconds()),
 	})
 	if err != nil {
 		log.Tag(tagWebPush).Err(err).Fields(*ctx).Debug("Unable to publish web push message, removing endpoint")