Loading mnpw/__init__.py +10 −5 Original line number Diff line number Diff line Loading @@ -16,11 +16,16 @@ HOSTNAME = socket.gethostname() def notify(message): """Send a notification.""" for _ in range(3): r = requests.post( # pylint: disable=invalid-name "https://notify.shore.co.il/send", params={"message": message} ) if not r.ok: logging.error(f"Failed to send notification: {r.reason}.") if r.ok: return logging.warning( f"Failed to send notification: {r.reason}, will retry." ) logging.error("Failed to send notification.") def main(): # noqa: MC0001 Loading Loading
mnpw/__init__.py +10 −5 Original line number Diff line number Diff line Loading @@ -16,11 +16,16 @@ HOSTNAME = socket.gethostname() def notify(message): """Send a notification.""" for _ in range(3): r = requests.post( # pylint: disable=invalid-name "https://notify.shore.co.il/send", params={"message": message} ) if not r.ok: logging.error(f"Failed to send notification: {r.reason}.") if r.ok: return logging.warning( f"Failed to send notification: {r.reason}, will retry." ) logging.error("Failed to send notification.") def main(): # noqa: MC0001 Loading