Add a timeout when shutting down the server.

The browser needs to be closed for graceful shutdown. If the browser
is left open the microscope may never shut down as it is waiting on
the uvicorn process to finish. This causes potential SD card issues.

This forces the server to force shutdown if it doesn't exit gracefully in
2 seconds.
This commit is contained in:
Julian Stirling 2025-06-19 16:25:43 -04:00
parent b01032be99
commit cdf23bc403

View file

@ -60,6 +60,7 @@ def serve_from_cli(argv: Optional[list[str]] = None):
host=args.host,
port=args.port,
log_config=log_config,
timeout_graceful_shutdown=2,
)
except BaseException as e: