Skip to content

Commit 8667d54

Browse files
committed
added 'ttl' as argument for webpush function
Closes #85
1 parent 28d2b55 commit 8667d54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pywebpush/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ def webpush(subscription_info,
307307
vapid_claims=None,
308308
content_encoding="aesgcm",
309309
curl=False,
310-
timeout=None):
310+
timeout=None,
311+
ttl=0):
311312
"""
312313
One call solution to endcode and send `data` to the endpoint
313314
contained in `subscription_info` using optional VAPID auth headers.
@@ -347,6 +348,8 @@ def webpush(subscription_info,
347348
:type curl: bool
348349
:param timeout: POST requests timeout
349350
:type timeout: float or tuple
351+
:param ttl: Time To Live
352+
:type ttl: int
350353
:return requests.Response or string
351354
352355
"""
@@ -371,6 +374,7 @@ def webpush(subscription_info,
371374
result = WebPusher(subscription_info).send(
372375
data,
373376
vapid_headers,
377+
ttl=ttl,
374378
content_encoding=content_encoding,
375379
curl=curl,
376380
timeout=timeout,

0 commit comments

Comments
 (0)