mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix(video): report a cancelled generation as 499
process_images swallows the interrupt assertion, so a cancel reaches the shared video core as an empty result and was raised as 'processing failed' with 500, leaving clients unable to tell a cancel from a crash. Mirrors the LTX path, which already returns 499.
This commit is contained in:
@@ -307,6 +307,10 @@ def run(selected: models_def.Model, *,
|
||||
if err:
|
||||
raise VideoError(err, 500)
|
||||
if processed is None or (len(processed.images) == 0 and processed.bytes is None):
|
||||
# process_images swallows the interrupt assertion, so an empty result is the only place
|
||||
# a cancel and a genuine failure are still distinguishable
|
||||
if shared.state.interrupted or shared.state.skipped:
|
||||
raise VideoError('interrupted', 499)
|
||||
raise VideoError('processing failed', 500)
|
||||
log.info(f'Video: name="{selected.name}" cls={shared.sd_model.__class__.__name__} frames={len(processed.images)} time={t1-t0:.2f}')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user