feat: update README and main.py to clarify port usage and add error handling for socket port
All checks were successful
Build Docker Images for Pull Request / build (pull_request) Successful in 17m5s
All checks were successful
Build Docker Images for Pull Request / build (pull_request) Successful in 17m5s
This commit is contained in:
7
main.py
7
main.py
@@ -230,7 +230,12 @@ if __name__ == '__main__':
|
||||
setupStats(driver, url)
|
||||
|
||||
socket_url = firstValid(args.socket_url, os.getenv('SOCKET_URL'), default='localhost')
|
||||
socket_port = firstValid(args.socket_port, os.getenv('SOCKET_PORT'), default=8094)
|
||||
try:
|
||||
socket_port = int(firstValid(args.socket_port, os.getenv('SOCKET_PORT'), default=8094))
|
||||
except ValueError:
|
||||
logger.error('Invalid socket port provided. Exiting.')
|
||||
raise SystemExit(1)
|
||||
|
||||
logger.info('Starting server collector.')
|
||||
httpd = HTTPServer(('', 9092), partial(Handler, downloadStats, driver, logger, socket_url, socket_port))
|
||||
httpd.serve_forever()
|
Reference in New Issue
Block a user