From 0e4f596401486b1552b5b7b3380663ac8d6b8b5e Mon Sep 17 00:00:00 2001 From: gilesb Date: Thu, 8 Jan 2026 01:47:23 +0000 Subject: [PATCH] Fix render_effect to find uploads in new cache location The legacy render_effect task was looking for inputs only at CACHE_DIR/{hash}, but uploads now go through cache_manager which stores them in CACHE_DIR/nodes/{node_id}/. Now uses cache_manager.get_by_content_hash() which checks both locations. Co-Authored-By: Claude Opus 4.5 --- tasks.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tasks.py b/tasks.py index 62ebb76..6b98f54 100644 --- a/tasks.py +++ b/tasks.py @@ -154,8 +154,7 @@ def render_effect(self, input_hash: str, effect_name: str, output_name: str) -> Returns: Provenance record with output hash """ - # Cache directory (shared between server and worker) - CACHE_DIR = Path(os.environ.get("CACHE_DIR", str(Path.home() / ".artdag" / "cache"))) + from cache_manager import get_cache_manager # Registry hashes (for effects/infra metadata only) REGISTRY = { @@ -173,9 +172,10 @@ def render_effect(self, input_hash: str, effect_name: str, output_name: str) -> } } - # Input comes from cache by hash - input_path = CACHE_DIR / input_hash - if not input_path.exists(): + # Input comes from cache by hash (supports both legacy and new cache locations) + cache_manager = get_cache_manager() + input_path = cache_manager.get_by_content_hash(input_hash) + if not input_path or not input_path.exists(): raise ValueError(f"Input not in cache: {input_hash}") output_dir = CACHE_DIR