diff --git a/dch_webhooks.py b/dch_webhooks.py index 69816b0..3b9037b 100644 --- a/dch_webhooks.py +++ b/dch_webhooks.py @@ -317,14 +317,16 @@ async def ntfy( tags: Optional[str] = None, attach: Optional[bytes] = None, filename: Optional[str] = None, + cache: Optional[bool] = None, ) -> None: assert message or attach - headers = { - } + headers = {} if title: headers['Title'] = title if tags: headers['Tags'] = tags + if cache is not None: + headers['Cache'] = 'yes' if cache else 'no' url = f'{NTFY_URL}/{topic}' client = httpx.AsyncClient() if attach: @@ -422,6 +424,6 @@ async def jenkins_notify(request: fastapi.Request) -> None: return try: - await ntfy(message, 'jenkins', title, tag) + await ntfy(message, 'jenkins', title, tag, cache=False) except httpx.HTTPError: log.exception('Failed to send notification:')