Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Agent listening job: a forgotten subtitle job fails as listen_failed instead of a generic error

Bowen Xuea62d123a815f
diff --git a/freevideo_engine/agent/projects.py b/freevideo_engine/agent/projects.py
index ddcb13e..02a5a17 100644
--- a/freevideo_engine/agent/projects.py
+++ b/freevideo_engine/agent/projects.py
@@ -534,13 +534,17 @@ def run_listen(port, row, *, poll=.25):
raise JobError('busy', 'The subtitle queue is full; retry shortly') from error
identity, cancelled = view['id'], False
row['_phase'] = 'listening'
- while view['state'] == 'running':
- if row.get('_cancel') and not cancelled:
- view, cancelled = queue.cancel(identity), True
- continue
- row['_detail'] = json.dumps(dict(fraction=round(view['fraction'], 3)))
- time.sleep(poll)
- view = queue.get(identity)
+ try:
+ while view['state'] == 'running':
+ if row.get('_cancel') and not cancelled:
+ view, cancelled = queue.cancel(identity), True
+ continue
+ row['_detail'] = json.dumps(dict(fraction=round(view['fraction'], 3)))
+ time.sleep(poll)
+ view = queue.get(identity)
+ except KeyError as error:
+ # The page's queue forgot this job (its record cap recycles finished ones) before the result was read.
+ raise JobError('listen_failed', 'Listening finished but the subtitle service no longer has the result; retry') from error
if view['state'] == 'cancelled':
raise JobError('cancelled', 'Cancelled')
if view['state'] != 'done':