Skip to content

Commit

Permalink
Merge pull request #219 from DanSipola/webhook_timeouts
Browse files Browse the repository at this point in the history
Add timeouts to webhook requests
  • Loading branch information
vicsufer authored Oct 23, 2020
2 parents 6f51514 + d5a9653 commit 87323aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## [Unreleased](https://github.com/idealista/prom2teams/tree/develop)

### Fixed
- *[#219](https://github.com/idealista/prom2teams/pull/219) Add timeouts to webhook request to prevent hanging tcp connections in case of network errors* @DanSipola
### Added
- *[#222](https://github.com/idealista/prom2teams/pull/222) Add restrictive security context since the workload doesn't need more permissions to work.* @azman0101


## [3.0.0](https://github.com/idealista/prom2teams/tree/3.0.0)
[Full Changelog](https://github.com/idealista/prom2teams/compare/2.7.0...3.0.0)
### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion prom2teams/app/teams_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def post(teams_webhook_url, message):
response = session.post(teams_webhook_url, data=message)
response = session.post(teams_webhook_url, data=message, timeout=(5,20))
if not response.ok or response.text is not '1':
exception_msg = 'Error performing request to: {}.\n' \
' Returned status code: {}.\n' \
Expand Down

0 comments on commit 87323aa

Please sign in to comment.