Change ttl dynamically

This commit is contained in:
Nicolas Mowen 2024-07-21 19:22:13 -06:00
parent 9d8104618e
commit 4808a7d7fd

View File

@ -152,11 +152,12 @@ class WebPushClient(Communicator): # type: ignore[misc]
endpoint[0 : endpoint.index("/", 10)] endpoint[0 : endpoint.index("/", 10)]
].copy() ].copy()
headers["urgency"] = "high" headers["urgency"] = "high"
ttl = 3600 if state == "end" else 0
# send message # send message
resp = pusher.send( resp = pusher.send(
headers=headers, headers=headers,
ttl=3600, ttl=ttl,
data=json.dumps( data=json.dumps(
{ {
"title": title, "title": title,