Spaces:
Runtime error
Runtime error
Commit History
-
feat(spaces): prune output dir before each generation
Verified signatureWithout cleanup, every video lands in `~/comfyui/output/` and stays there until the container restarts. The ephemeral disk is 150 GB and preload already eats ~111 GB, so accumulating generations on the ~39 GB headroom fills the disk and the replica goes unhealthy — observed today as a stuck `RUNNING` Space with `replicas.current=0` and the iframe returning `net::ERR_ABORTED`. Restart cleared it; this prevents the recurrence. 4 h TTL sweep at the top of `_on_generate`. Per-file `OSError` is swallowed so one bad inode can't abort the cleanup. Tests cover older-than-threshold deletion, recent-file retention, recursive descent into ComfyUI's `LTX2.3/` subdir, missing-dir tolerance, and directory preservation.de6853a