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.
This commit is contained in:
Dannon Baker
2026-06-03 10:26:52 -04:00
parent cb6d67dd37
commit 0064de80cf
+1 -5
View File
@@ -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