Skip to content

Commit

Permalink
Merge pull request #12 from idealista/bugs/10
Browse files Browse the repository at this point in the history
#10 Capturing Keyboard Interrupt and logging server stop event
  • Loading branch information
dortegau authored Aug 27, 2017
2 parents 61870a9 + befdd65 commit 64a1d50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
### Fixed
- *[#6](https://github.com/idealista/prom2teams/issues/6) Allow to define previously declared default values as blank values in provided config* @dortegau
- *[#8](https://github.com/idealista/prom2teams/issues/8) Closing all file descriptors and adding some unit tests* @dortegau
- *[#5](https://github.com/idealista/prom2teams/issues/5) Allow to provide log file path and log level as arguments* @dortegau
- *[#10](https://github.com/idealista/prom2teams/issues/10) Capturing Keyboard Interrupt and logging server stop event* @dortegau

## [1.0.0](https://github.com/idealista/prom2teams/tree/1.0.0)
Expand Down
8 changes: 7 additions & 1 deletion app/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def run(provided_config_file, template_path, log_file_path, log_level):
config['Microsoft Teams']['Connector'],
template_path)
httpd = HTTPServer(server_address, request_handler)
httpd.serve_forever()

try:
httpd.serve_forever()
except KeyboardInterrupt:
logger.info('server stopped')

httpd.server_close()


def get_config(default_config_file, provided_config_file):
Expand Down

0 comments on commit 64a1d50

Please sign in to comment.