feat(api): display warning when port is in use

This commit is contained in:
psychedelicious 2023-07-13 21:42:26 +10:00 committed by Kent Keirsey
parent c557402dbb
commit 509514f11d

View File

@ -205,6 +205,8 @@ def invoke_api():
return port
port = find_port(app_config.port)
if port != app_config.port:
logger.warn(f"Port {app_config.port} in use, using port {port}")
# Start our own event loop for eventing usage
loop = asyncio.new_event_loop()
config = uvicorn.Config(app=app, host=app_config.host, port=port, loop=loop)