alter way of alerting info of empty task (#2094)

### What problem does this PR solve?

#2043

### Type of change

- [x] Refactoring
This commit is contained in:
Kevin Hu 2024-08-26 13:45:26 +08:00 committed by GitHub
parent a6d85c6c2f
commit e9202999cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"