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