diff options
author | John Estabrook <jestabro@vyos.io> | 2020-05-06 17:49:12 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2020-05-06 19:12:32 -0500 |
commit | 7b31dd720d96bc481323e3b00100da718f551cd5 (patch) | |
tree | a4c0376134aaeb6afc213b5dfc963eae9a07730b /src/services | |
parent | c4312498ebe0643061f1d06ad9655d49fb9d9af7 (diff) | |
download | vyos-1x-7b31dd720d96bc481323e3b00100da718f551cd5.tar.gz vyos-1x-7b31dd720d96bc481323e3b00100da718f551cd5.zip |
http api: T2395: add waitress as production WSGI server
Diffstat (limited to 'src/services')
-rwxr-xr-x | src/services/vyos-http-api-server | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server index 4a653bb66..4c41fa96d 100755 --- a/src/services/vyos-http-api-server +++ b/src/services/vyos-http-api-server @@ -27,6 +27,7 @@ import signal import vyos.config from flask import Flask, request +from waitress import serve from functools import wraps @@ -395,4 +396,8 @@ if __name__ == '__main__': signal.signal(signal.SIGTERM, sig_handler) - app.run(host=server_config["listen_address"], port=server_config["port"], debug=True) + try: + serve(app, host=server_config["listen_address"], + port=server_config["port"]) + except OSError as e: + print(f"OSError {e}") |