Skip to content

Commit

Permalink
Make ttl dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Jul 22, 2024
1 parent 9d81046 commit 5d72be6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frigate/comms/webpush.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ def send_alert(self, payload: dict[str, any]) -> None:
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,
Expand Down
1 change: 0 additions & 1 deletion web/public/notifications-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ self.addEventListener("push", function (event) {
icon: "/images/maskable-icon.png",
image: data.image,
badge: "/images/maskable-badge.png",
tag: data.id,
data: { id: data.id, link: data.direct_url },
});
} else {
Expand Down

0 comments on commit 5d72be6

Please sign in to comment.