Skip to content
Snippets Groups Projects
Commit e4d9bd1e authored by nimrod's avatar nimrod
Browse files

Notifcation retries.

parent 21ff987e
No related branches found
No related tags found
No related merge requests found
...@@ -16,11 +16,16 @@ HOSTNAME = socket.gethostname() ...@@ -16,11 +16,16 @@ HOSTNAME = socket.gethostname()
def notify(message): def notify(message):
"""Send a notification.""" """Send a notification."""
for _ in range(3):
r = requests.post( # pylint: disable=invalid-name r = requests.post( # pylint: disable=invalid-name
"https://notify.shore.co.il/send", params={"message": message} "https://notify.shore.co.il/send", params={"message": message}
) )
if not r.ok: if r.ok:
logging.error(f"Failed to send notification: {r.reason}.") return
logging.warning(
f"Failed to send notification: {r.reason}, will retry."
)
logging.error("Failed to send notification.")
def main(): # noqa: MC0001 def main(): # noqa: MC0001
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment