fix: dispatcher/poller 超时改为分离模式,stale_timeout 缩短到 10 分钟
- dispatcher 上传 timeout 从 300s 改为 (10s connect, 60s read) 避免大文件上传无限阻塞 dispatcher 线程 - poller 拉取 timeout 从 30s 改为 (10s connect, 15s read) - stale_timeout 从 3600s 缩短到 600s(10 分钟) 更快回收卡死的 PROCESSING 任务
This commit is contained in:
@@ -30,7 +30,7 @@ dispatcher:
|
||||
edge_url: "http://129.146.203.203:5000/api/edge/video/enqueue"
|
||||
max_retries: 3
|
||||
upload_timeout: 300 # 仅视频上传时间(不含 AI 处理)
|
||||
stale_timeout: 3600 # PROCESSING 超时回收(Edge 处理 + 队列等待)
|
||||
stale_timeout: 600 # PROCESSING 超时回收(10分钟,Edge 处理 + 队列等待)
|
||||
|
||||
poller:
|
||||
poll_interval: 30
|
||||
|
||||
@@ -97,7 +97,7 @@ class Dispatcher:
|
||||
self.edge_url,
|
||||
data=payload,
|
||||
files={'video': (os.path.basename(video_path), fh, 'video/mp4')},
|
||||
timeout=self.upload_timeout
|
||||
timeout=(10, 60)
|
||||
)
|
||||
except requests.RequestException as e:
|
||||
logger.error(f"[task_id={task_id}] 上传失败: {e}")
|
||||
|
||||
@@ -75,7 +75,7 @@ class Poller:
|
||||
resp = requests.get(
|
||||
self.results_url,
|
||||
params={'limit': self.batch_size},
|
||||
timeout=self.timeout
|
||||
timeout=(10, 15)
|
||||
)
|
||||
except requests.RequestException as e:
|
||||
logger.error(f"拉取结果失败: {e}")
|
||||
|
||||
Reference in New Issue
Block a user