From 43ad472a4cf73fdc6b4ccb0d1dcd9fbdc7aca4ff Mon Sep 17 00:00:00 2001 From: "Vimal Paliwal (vim)" Date: Fri, 3 Jun 2022 09:42:38 +0530 Subject: [PATCH] add timeout (#17) * add timeout for requests module to avoid infinte waiting if no response is received * update bug issue template --- .github/ISSUE_TEMPLATE/1-bug-report.yml | 10 +++++----- src/mailgun_mailer.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.yml b/.github/ISSUE_TEMPLATE/1-bug-report.yml index 843d13d..465bf20 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/1-bug-report.yml @@ -12,8 +12,6 @@ body: options: - label: I am running the latest version required: true - - label: I read the documentation properly and found no answer - required: true - label: I have checked to make sure that this issue has not already been filed required: true - type: textarea @@ -45,15 +43,17 @@ body: description: | Example: - **Operating System**: Ubuntu 20.04 - - **Terraform Version**: 1.4.0 - - **Provider version**: v2.16.0 (AWS Provider Version) + - **Terraform Version**: 1.1.0 + - **Provider version**: 4.16.0 (AWS Provider Version) - **Module Version**: v1.0.0 + - **Python Version**: 3.9 value: | - Operating System: - Terraform Version: - Provider version: - Module Version: - render: markdown + - Python Version: + render: Markdown validations: required: true - type: textarea diff --git a/src/mailgun_mailer.py b/src/mailgun_mailer.py index 2cb2543..b23b3de 100644 --- a/src/mailgun_mailer.py +++ b/src/mailgun_mailer.py @@ -27,7 +27,7 @@ def send_email(mailTo, userName, mailSubject, mailFrom, mailBodyPlain, mailBodyH apiKey = resp['Parameter']['Value'] logger.info('Sending mail to {} ({}) via Mailgun'.format(userName, mailTo)) - resp = requests.post(MAILGUN_API_URL, auth=("api", apiKey), + resp = requests.post(MAILGUN_API_URL, auth=("api", apiKey), timeout=3, data={"from": mailFrom, "to": [mailTo], "subject": mailSubject,