mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 06:21:36 +01:00
fix: honor 429 response
This commit is contained in:
@@ -78,6 +78,9 @@ def ntfy_send(dispatch_uuid, user_topic, title, message, ntfy_push_target, ntfy_
|
|||||||
# send #
|
# send #
|
||||||
r = requests.post(ntfy_push_target, auth=(ntfy_user, ntfy_pass), json=payload)
|
r = requests.post(ntfy_push_target, auth=(ntfy_user, ntfy_pass), json=payload)
|
||||||
print(r.status_code, r.text, payload)
|
print(r.status_code, r.text, payload)
|
||||||
|
if r.status_code == 429: # rate-limit
|
||||||
|
time.sleep(60)
|
||||||
|
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
# talk to dispatch #
|
# talk to dispatch #
|
||||||
|
|||||||
Reference in New Issue
Block a user