Skip to content

Commit

Permalink
add timeout (#17)
Browse files Browse the repository at this point in the history
* add timeout for requests module to avoid infinte waiting if no response is received

* update bug issue template
  • Loading branch information
paliwalvimal authored Jun 3, 2022
1 parent 74a25bf commit 43ad472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/mailgun_mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 43ad472

Please sign in to comment.