File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,9 @@ async def _upload_ports() -> None:
148148 task_name = f"outputs_manager_port_keys-{ '_' .join (port_keys )} "
149149 self ._task_uploading = create_task (_upload_ports (), name = task_name )
150150
151+ # used to retain task to avoid early garabage collection
152+ cleanup_task : Task | None = None
153+
151154 def _remove_downloads (future : Future ) -> None :
152155 # pylint: disable=protected-access
153156 if future ._exception is not None :
@@ -171,7 +174,8 @@ def _remove_downloads(future: Future) -> None:
171174 except Exception as e : # pylint: disable=broad-except
172175 self ._last_upload_error_tracker [port_key ] = e
173176
174- create_task (self ._port_key_tracker .remove_all_uploading ())
177+ nonlocal cleanup_task
178+ cleanup_task = create_task (self ._port_key_tracker .remove_all_uploading ())
175179
176180 self ._task_uploading .add_done_callback (_remove_downloads )
177181
You can’t perform that action at this time.
0 commit comments