From 2aa5aa6d875b4078a77c166a7c8d51795e8f253c Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Wed, 12 Mar 2025 11:28:23 +0100 Subject: [PATCH 1/2] fixed issue with task not started --- .../agent/src/simcore_service_agent/services/volumes_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/agent/src/simcore_service_agent/services/volumes_manager.py b/services/agent/src/simcore_service_agent/services/volumes_manager.py index d26062a936e9..ae96db1106b1 100644 --- a/services/agent/src/simcore_service_agent/services/volumes_manager.py +++ b/services/agent/src/simcore_service_agent/services/volumes_manager.py @@ -52,7 +52,7 @@ async def setup(self) -> None: task_name="volumes bookkeeping", ) self._task_periodic_volume_cleanup = create_periodic_task( - self._bookkeeping_task, + self._periodic_volmue_cleanup_task, interval=self.volume_cleanup_interval, task_name="volume cleanup", ) From 7ce10303603e79e5841a61b1191915a2f5356191 Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Wed, 12 Mar 2025 12:35:56 +0100 Subject: [PATCH 2/2] typo --- .../src/simcore_service_agent/services/volumes_manager.py | 4 ++-- services/agent/tests/unit/test_services_volumes_manager.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/agent/src/simcore_service_agent/services/volumes_manager.py b/services/agent/src/simcore_service_agent/services/volumes_manager.py index ae96db1106b1..860ab86d0e21 100644 --- a/services/agent/src/simcore_service_agent/services/volumes_manager.py +++ b/services/agent/src/simcore_service_agent/services/volumes_manager.py @@ -52,7 +52,7 @@ async def setup(self) -> None: task_name="volumes bookkeeping", ) self._task_periodic_volume_cleanup = create_periodic_task( - self._periodic_volmue_cleanup_task, + self._periodic_volume_cleanup_task, interval=self.volume_cleanup_interval, task_name="volume cleanup", ) @@ -96,7 +96,7 @@ async def _remove_volume_safe( requires_backup=requires_backup, ) - async def _periodic_volmue_cleanup_task(self) -> None: + async def _periodic_volume_cleanup_task(self) -> None: with log_context(_logger, logging.DEBUG, "volume cleanup"): volumes_to_remove: set[str] = set() for volume_name, inactive_since in self._unused_volumes.items(): diff --git a/services/agent/tests/unit/test_services_volumes_manager.py b/services/agent/tests/unit/test_services_volumes_manager.py index 4ac429aeca93..5fae32710dfe 100644 --- a/services/agent/tests/unit/test_services_volumes_manager.py +++ b/services/agent/tests/unit/test_services_volumes_manager.py @@ -165,7 +165,7 @@ async def test_volumes_manager_periodic_task_cleanup( ): async def _run_volumes_clennup() -> None: await volumes_manager._bookkeeping_task() # noqa: SLF001 - await volumes_manager._periodic_volmue_cleanup_task() # noqa: SLF001 + await volumes_manager._periodic_volume_cleanup_task() # noqa: SLF001 await _run_volumes_clennup() assert spy_remove_volume.call_count == 0