summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2021-07-26 07:39:07 +0300
committerMaxim Devaev <[email protected]>2021-07-26 07:39:07 +0300
commit365f06a2e8ca03e3dca4f3fe9133ddac6d36f4ba (patch)
treedc67dec22e0dc5f511f97140054fa53a1a50b2d5 /kvmd
parent25c9c63788b5b849c4ff8b9445b551b6cf4b503d (diff)
fixed long shutdown
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/apps/kvmd/http.py1
-rw-r--r--kvmd/apps/kvmd/server.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/kvmd/apps/kvmd/http.py b/kvmd/apps/kvmd/http.py
index c1525046..e436844a 100644
--- a/kvmd/apps/kvmd/http.py
+++ b/kvmd/apps/kvmd/http.py
@@ -240,6 +240,7 @@ class HttpServer:
aiohttp.web.run_app(
app=self._make_app(),
+ shutdown_timeout=1,
access_log_format=access_log_format,
print=self.__run_app_print,
**socket_kwargs,
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py
index 08b310d0..a8c4d0d6 100644
--- a/kvmd/apps/kvmd/server.py
+++ b/kvmd/apps/kvmd/server.py
@@ -367,6 +367,8 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins
for client in list(self.__ws_clients):
await self.__remove_ws_client(client)
+ logger.info("On-Shutdown complete")
+
async def __on_cleanup(self, _: aiohttp.web.Application) -> None:
logger = get_logger(0)
for component in self.__components:
@@ -376,6 +378,7 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins
await component.cleanup() # type: ignore
except Exception:
logger.exception("Cleanup error on %s", component.name)
+ logger.info("On-Cleanup complete")
async def __send_event(self, ws: aiohttp.web.WebSocketResponse, event_type: str, event: Optional[Dict]) -> None:
await ws.send_str(json.dumps({