We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af11ef4 commit 6a719b4Copy full SHA for 6a719b4
src/backEnd/api/commonApi/webTaskController.py
@@ -1,5 +1,6 @@
1
# Web端扫描任务提交接口
2
# 与BurpSuite插件端共用相同的业务逻辑,但日志来源区分
3
+import asyncio
4
import logging
5
6
from fastapi import HTTPException
@@ -74,9 +75,10 @@ async def add_task_from_web(
74
75
76
if res.success:
77
logger.info(f"[Web] Task created successfully: {res.data}")
- # 通知前端刷新数据
78
+ # 通知前端刷新数据(使用 fire-and-forget 模式,避免阻塞响应)
79
task_id = res.data.get('taskid') if isinstance(res.data, dict) else None
- await ws_manager.notify_task_created(task_id)
80
+ # 创建异步任务发送通知,不阻塞当前请求
81
+ asyncio.create_task(ws_manager.notify_task_created(task_id))
82
else:
83
logger.warning(f"[Web] Task creation failed: {res.msg}")
84
0 commit comments