From 2a74d9816fc97561cb3fa437515f177b232bbee8 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Sun, 5 Jan 2025 15:17:48 +0100 Subject: [PATCH] fix: honor 429 response --- client/dispatch-query.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/dispatch-query.py b/client/dispatch-query.py index 0bebb21..a38d5a3 100755 --- a/client/dispatch-query.py +++ b/client/dispatch-query.py @@ -78,6 +78,9 @@ def ntfy_send(dispatch_uuid, user_topic, title, message, ntfy_push_target, ntfy_ # send # r = requests.post(ntfy_push_target, auth=(ntfy_user, ntfy_pass), json=payload) print(r.status_code, r.text, payload) + if r.status_code == 429: # rate-limit + time.sleep(60) + r.raise_for_status() # talk to dispatch #