From c196b01b3c8ac5fd108d48a970346c53286e17ee Mon Sep 17 00:00:00 2001 From: alfredeen Date: Fri, 16 Aug 2024 16:48:49 +0200 Subject: [PATCH] Minor corrections to spelling --- .gitignore | 3 +++ serve_event_listener/event_listener.py | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index f9f24dc..e9d687e 100644 --- a/.gitignore +++ b/.gitignore @@ -151,6 +151,9 @@ node_modules .DS_Store .idea/ +# VSCode configurations +.vscode + # The media folder contents media/* !media/.gitkeep diff --git a/serve_event_listener/event_listener.py b/serve_event_listener/event_listener.py index 2b91866..d97a17d 100644 --- a/serve_event_listener/event_listener.py +++ b/serve_event_listener/event_listener.py @@ -99,6 +99,8 @@ def listen(self) -> None: ) max_retries = 10 + + # Duration in seconds to wait between retrying used when some exceptions occur retry_delay = 2 if self.setup_complete: @@ -251,7 +253,7 @@ def post( elif status_code in [401, 403]: logger.warning( - f"Recieved status code {status_code} - Fetching new token and retrying once" + f"Received status code {status_code} - Fetching new token and retrying once" ) self.token = self.fetch_token() self._status_queue.token = self.token @@ -263,17 +265,17 @@ def post( elif status_code in [404]: logger.warning( - f"Recieved status code {status_code} - {response.text}" + f"Received status code {status_code} - {response.text}" ) break elif str(status_code).startswith("5"): - logger.warning(f"Recieved status code {status_code}") + logger.warning(f"Received status code {status_code}") logger.warning(f"Retrying in {sleep} seconds") time.sleep(sleep) else: - logger.warning(f"Recieved uncaught status code: {status_code}") + logger.warning(f"Received uncaught status code: {status_code}") logger.info(f"POST returned - Status code: {status_code}")