Another fix for refresh.

This commit is contained in:
=
2026-02-04 22:32:27 -05:00
parent fdad92047b
commit dbc5878fe2
3 changed files with 35 additions and 13 deletions

View File

@@ -1196,7 +1196,11 @@ def rewrite_chapter(run_id):
@app.route('/task_status/<string:task_id>')
@login_required
def get_task_status(task_id):
task_result = huey.result(task_id, peek=True)
try:
task_result = huey.result(task_id, preserve=True)
except Exception as e:
# If Huey errors out, report it as a failed task so the UI can react
return {"status": "completed", "success": False, "error": str(e)}
if task_result is None:
return {"status": "running"}