Added timestamp option
This commit is contained in:
1 parent
a1d3093241
commit
ae9cd00cce
2 files changed
+3
-2
No files matched your search
+1
-1
@@ -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" }]
|
||||||
|
|||||||
@@ -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()),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user