mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
Merge pull request #5060 from vladmandic/fix/queue-lock-exception-suppression
fix(queue): stop the queue lock from suppressing exceptions
This commit is contained in:
@@ -25,7 +25,7 @@ class Queue:
|
||||
if _queue_debug:
|
||||
fn = f'{sys._getframe(3).f_code.co_name}:{sys._getframe(2).f_code.co_name}:{sys._getframe(1).f_code.co_name}' # pylint: disable=protected-access
|
||||
log.debug(f'Queue: unlock state={_queue_lock.locked()} fn={fn}')
|
||||
return _queue_lock
|
||||
# no return: a truthy __exit__ suppresses the exception in flight
|
||||
|
||||
|
||||
queue_lock = Queue() # public lock for external use
|
||||
|
||||
@@ -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