From 0064de80cffdf81ccfd0984671c98756a69715b1 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Sun, 31 May 2026 13:50:37 -0400 Subject: [PATCH] Hoist the iwc import in refresh_iwc_manifest to module top The local import claimed to keep cachetools/requests out of celery's startup graph, but cachetools is already pulled in transitively (NotificationManager -> sse_dispatch) and requests is resident in any worker that boots galaxy.app. There's no circular-import risk either, and the sibling refresh_gtn_database imports GTNSearchDB at the top -- so hoist this one for consistency and drop the comment. --- lib/galaxy/celery/tasks.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/galaxy/celery/tasks.py b/lib/galaxy/celery/tasks.py index f2be0cd4565..48e079decd6 100644 --- a/lib/galaxy/celery/tasks.py +++ b/lib/galaxy/celery/tasks.py @@ -26,6 +26,7 @@ from sqlalchemy import ( ) from galaxy import model +from galaxy.agents import iwc from galaxy.agents.gtn import GTNSearchDB from galaxy.celery import ( celery_app, @@ -840,11 +841,6 @@ def refresh_iwc_manifest(config: GalaxyAppConfiguration): so an iwc.galaxyproject.org outage doesn't kill the periodic queue -- on-demand callers still get the prior cached copy until the TTL lapses. """ - # Local import keeps the iwc module (and its cachetools / requests - # imports) out of celery's startup graph -- they only load on the - # workers that actually run this task. - from galaxy.agents import iwc - try: manifest = iwc.refresh_manifest() except Exception as e: # noqa: BLE001 -- best-effort warm; resilience over precision