Browse Source

Terminate ob-watcher immediately if HTTP server fails to start

master
Kristaps Kaupe 6 years ago
parent
commit
8997147848
No known key found for this signature in database
GPG Key ID: D47B1B4232B55437
  1. 6
      scripts/obwatch/ob-watcher.py

6
scripts/obwatch/ob-watcher.py

@ -372,8 +372,12 @@ class HTTPDThread(threading.Thread):
def run(self):
# hostport = ('localhost', 62601)
httpd = http.server.HTTPServer(self.hostport,
try:
httpd = http.server.HTTPServer(self.hostport,
OrderbookPageRequestHeader)
except Exception as e:
print("Failed to start HTTP server: " + str(e))
os._exit(EXIT_FAILURE)
httpd.taker = self.taker
print('\nstarted http server, visit http://{0}:{1}/\n'.format(
*self.hostport))

Loading…
Cancel
Save