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 <noreply@anthropic.com>
This commit is contained in:
10
tasks.py
10
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
|
||||
|
||||
Reference in New Issue
Block a user