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)]
].copy()
headers["urgency"] = "high"
ttl = 3600 if state == "end" else 0
# send message
resp = pusher.send(
headers=headers,
ttl=3600,
ttl=ttl,
data=json.dumps(
{
"title": title,