mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 16:38:59 +08:00
Set task progress on exception (#4025)
### What problem does this PR solve? Set task progress on exception ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
93635674c3
commit
86507af770
@ -502,12 +502,19 @@ def handle_task():
|
|||||||
with mt_lock:
|
with mt_lock:
|
||||||
DONE_TASKS += 1
|
DONE_TASKS += 1
|
||||||
CURRENT_TASK = None
|
CURRENT_TASK = None
|
||||||
logging.info(f"handle_task got TaskCanceledException for task {json.dumps(task)}")
|
try:
|
||||||
|
set_progress(task["id"], prog=-1, msg="handle_task got TaskCanceledException")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
logging.debug("handle_task got TaskCanceledException", exc_info=True)
|
logging.debug("handle_task got TaskCanceledException", exc_info=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
with mt_lock:
|
with mt_lock:
|
||||||
FAILED_TASKS += 1
|
FAILED_TASKS += 1
|
||||||
CURRENT_TASK = None
|
CURRENT_TASK = None
|
||||||
|
try:
|
||||||
|
set_progress(task["id"], prog=-1, msg="handle_task got exception, please check log")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
logging.exception(f"handle_task got exception for task {json.dumps(task)}")
|
logging.exception(f"handle_task got exception for task {json.dumps(task)}")
|
||||||
if PAYLOAD:
|
if PAYLOAD:
|
||||||
PAYLOAD.ack()
|
PAYLOAD.ack()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user