improved logging
This commit is contained in:
@@ -30,6 +30,8 @@ class WebUiServer:
|
||||
|
||||
def start(self) -> None:
|
||||
"""Start serving on the background thread."""
|
||||
config = self._server.config
|
||||
logger.info("Starting web UI server on %s:%s", config.host, config.port)
|
||||
self._thread.start()
|
||||
|
||||
def is_alive(self) -> bool:
|
||||
@@ -49,5 +51,8 @@ class WebUiServer:
|
||||
|
||||
def stop(self) -> None:
|
||||
"""Ask uvicorn to exit and wait briefly for the thread to unwind."""
|
||||
logger.info("Stopping web UI server")
|
||||
self._server.should_exit = True
|
||||
self._thread.join(timeout=5.0)
|
||||
if self._thread.is_alive():
|
||||
logger.warning("Web UI server thread did not stop within timeout")
|
||||
|
||||
Reference in New Issue
Block a user