From e9202999cbcc5ec3c321eecbfd7f201b893efc33 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 26 Aug 2024 13:45:26 +0800 Subject: [PATCH] alter way of alerting info of empty task (#2094) ### What problem does this PR solve? #2043 ### Type of change - [x] Refactoring --- rag/svr/task_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.py index febfc7699..3e86573c6 100644 --- a/rag/svr/task_executor.py +++ b/rag/svr/task_executor.py @@ -118,7 +118,10 @@ def collect(): cron_logger.info("Task {} has been canceled.".format(msg["id"])) return pd.DataFrame() tasks = TaskService.get_tasks(msg["id"]) - assert tasks, "{} empty task!".format(msg["id"]) + if not tasks: + cron_logger.warn("{} empty task!".format(msg["id"])) + return [] + tasks = pd.DataFrame(tasks) if msg.get("type", "") == "raptor": tasks["task_type"] = "raptor"