Skip to content

Commit

Permalink
fix(server): include error message in settimeout attempt, remove unus…
Browse files Browse the repository at this point in the history
…ed params
  • Loading branch information
ssube committed Aug 18, 2019
1 parent 39887bb commit 30e217f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus_express/server.py
Expand Up @@ -4,7 +4,7 @@
http_encoding = 'utf-8'


def start_http_server(port, address='0.0.0.0', extraRoutes={}, metricsRoute='/metrics'):
def start_http_server(port, address='0.0.0.0'):
bind_address = (address, port)

http_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Expand All @@ -13,8 +13,8 @@ def start_http_server(port, address='0.0.0.0', extraRoutes={}, metricsRoute='/me

try:
http_socket.settimeout(5.0)
except OSError:
print('Unable to set socket timeout')
except OSError as err:
print('Unable to set socket timeout:', err)

return Server(http_socket)

Expand Down

0 comments on commit 30e217f

Please sign in to comment.