diff --git a/examples/scripts/listener_with_custom_connector.py b/examples/scripts/listener_with_custom_connector.py index 7c1c17f..6041d69 100644 --- a/examples/scripts/listener_with_custom_connector.py +++ b/examples/scripts/listener_with_custom_connector.py @@ -33,7 +33,8 @@ def submit(self, parser): resp = requests.post( url=self.config["url"], headers={'Content-Type': 'application/json'}, - json={"msg": f"{subject}\n{content}\n{date}\n{some_specific_header}"} + json={"msg": f"{subject}\n{content}\n{date}\n{some_specific_header}"}, + timeout=30 ) self.log.debug(f"connector 'my_custom_connector' responded with {resp.status_code} status {resp.text}") except Exception as req_err: diff --git a/mail2beyond/connectors/discord.py b/mail2beyond/connectors/discord.py index 348c59b..34b7ca1 100644 --- a/mail2beyond/connectors/discord.py +++ b/mail2beyond/connectors/discord.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json'}, - json={"content": f"*{parser.subject}*\n\n{parser.content}"} + json={"content": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as discord_req_err: diff --git a/mail2beyond/connectors/google_chat.py b/mail2beyond/connectors/google_chat.py index c12ea49..e7fa784 100644 --- a/mail2beyond/connectors/google_chat.py +++ b/mail2beyond/connectors/google_chat.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json; charset=UTF-8'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as google_chat_req_err: diff --git a/mail2beyond/connectors/microsoft_teams.py b/mail2beyond/connectors/microsoft_teams.py index 293283e..3e54a10 100644 --- a/mail2beyond/connectors/microsoft_teams.py +++ b/mail2beyond/connectors/microsoft_teams.py @@ -19,7 +19,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json; charset=utf-8'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as microsoft_teams_req_err: diff --git a/mail2beyond/connectors/slack.py b/mail2beyond/connectors/slack.py index af2e23c..da00296 100644 --- a/mail2beyond/connectors/slack.py +++ b/mail2beyond/connectors/slack.py @@ -18,7 +18,8 @@ def submit(self, parser): resp = requests.post( url=self.config["webhook_url"], headers={'Content-Type': 'application/json'}, - json={"text": f"*{parser.subject}*\n\n{parser.content}"} + json={"text": f"*{parser.subject}*\n\n{parser.content}"}, + timeout=30 ) self.log.debug(f"connector '{self}' responded with {resp.status_code} status {resp.text}") except Exception as slack_req_err: diff --git a/requirements.txt b/requirements.txt index 2eaedbb..374088b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,6 @@ setuptools~=70.0.0 requests~=2.32.3 pyyaml~=6.0 pyOpenSSL~=24.1.0 -pylint~=2.14.5 +pylint~=3.2.3 html2text~=2024.2.26 pdoc3~=0.10.0