Added timestamp option

This commit is contained in:
florian committed 2026-11-09 20:42:15 +01:00
1 parent a1d3093241
commit ae9cd00cce
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "lib-send-notifications" name = "lib-send-notifications"
version = "0.1.0" version = "0.1.1"
description = "Shared library to send notifications via the internal backend API" description = "Shared library to send notifications via the internal backend API"
requires-python = ">=3.10" requires-python = ">=3.10"
authors = [{ name = "Florian Gänsejunge" }] authors = [{ name = "Florian Gänsejunge" }]
+2 -1
View File
@@ -82,6 +82,7 @@ class NotificationClient:
body: str, body: str,
link: str | None = None, link: str | None = None,
category: str = "utility", category: str = "utility",
timestamp: int | None = None,
*, *,
user_id: int = 1, user_id: int = 1,
max_attempts: int = 5, max_attempts: int = 5,
@@ -125,7 +126,7 @@ class NotificationClient:
"body": body, "body": body,
"link": link, "link": link,
"category": category, "category": category,
"timestamp": int(time.time()), "timestamp": timestamp if timestamp is not None else int(time.time()),
}, },
} }