Kevin Hu
commited on
Commit
·
fde0f31
1
Parent(s):
9f35ff5
alter way of alerting info of empty task (#2094)
Browse files### What problem does this PR solve?
#2043
### Type of change
- [x] Refactoring
- rag/svr/task_executor.py +4 -1
rag/svr/task_executor.py
CHANGED
@@ -118,7 +118,10 @@ def collect():
|
|
118 |
cron_logger.info("Task {} has been canceled.".format(msg["id"]))
|
119 |
return pd.DataFrame()
|
120 |
tasks = TaskService.get_tasks(msg["id"])
|
121 |
-
|
|
|
|
|
|
|
122 |
tasks = pd.DataFrame(tasks)
|
123 |
if msg.get("type", "") == "raptor":
|
124 |
tasks["task_type"] = "raptor"
|
|
|
118 |
cron_logger.info("Task {} has been canceled.".format(msg["id"]))
|
119 |
return pd.DataFrame()
|
120 |
tasks = TaskService.get_tasks(msg["id"])
|
121 |
+
if not tasks:
|
122 |
+
cron_logger.warn("{} empty task!".format(msg["id"]))
|
123 |
+
return []
|
124 |
+
|
125 |
tasks = pd.DataFrame(tasks)
|
126 |
if msg.get("type", "") == "raptor":
|
127 |
tasks["task_type"] = "raptor"
|