summaryrefslogtreecommitdiff
path: root/kvmd/apps/pst
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2022-06-19 04:10:42 +0300
committerMaxim Devaev <[email protected]>2022-06-19 04:10:42 +0300
commit805ff9dd5f43d32caead051c2ff18b72be0672c9 (patch)
treed7d961344f04961141d8234ff5a6c6392f0b4657 /kvmd/apps/pst
parent74e81b6e0345f37695c6cb05dd4fa2e489fd9026 (diff)
ro_cleanup_delay
Diffstat (limited to 'kvmd/apps/pst')
-rw-r--r--kvmd/apps/pst/server.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/kvmd/apps/pst/server.py b/kvmd/apps/pst/server.py
index 84a62bda..43086249 100644
--- a/kvmd/apps/pst/server.py
+++ b/kvmd/apps/pst/server.py
@@ -46,6 +46,7 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst
self,
storage_path: str,
ro_retries_delay: float,
+ ro_cleanup_delay: float,
remount_cmd: List[str],
) -> None:
@@ -53,6 +54,7 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst
self.__data_path = os.path.join(storage_path, "data")
self.__ro_retries_delay = ro_retries_delay
+ self.__ro_cleanup_delay = ro_cleanup_delay
self.__remount_cmd = remount_cmd
self.__notifier = aiotools.AioNotifier()
@@ -83,7 +85,8 @@ class PstServer(HttpServer): # pylint: disable=too-many-arguments,too-many-inst
await aiotools.stop_all_deadly_tasks()
logger.info("Disconnecting clients ...")
await self.__broadcast_storage_state(False)
- await self._close_all_wss()
+ if (await self._close_all_wss()):
+ await asyncio.sleep(self.__ro_cleanup_delay)
logger.info("On-Shutdown complete")
async def _on_cleanup(self) -> None: