From 8e40af7461f0e10bc9717771370725487fe4afd5 Mon Sep 17 00:00:00 2001 From: SXP-Simon Date: Sat, 7 Mar 2026 00:18:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(auto=5Fscheduler):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E6=80=A7=E8=83=BD=EF=BC=8C=E5=8E=9F=E6=9C=AC?= =?UTF-8?q?=E4=BA=A4=E9=94=99=E7=AD=89=E5=BE=85=EF=BC=88Stagger=EF=BC=89?= =?UTF-8?q?=E4=BC=9A=E9=98=BB=E5=A1=9E=E5=85=B6=E5=AE=83=E7=BE=A4=E8=81=8A?= =?UTF-8?q?=E7=9A=84=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/infrastructure/scheduler/auto_scheduler.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/infrastructure/scheduler/auto_scheduler.py b/src/infrastructure/scheduler/auto_scheduler.py index 42a9d22..10f4fa1 100644 --- a/src/infrastructure/scheduler/auto_scheduler.py +++ b/src/infrastructure/scheduler/auto_scheduler.py @@ -457,11 +457,11 @@ class AutoScheduler: sem = asyncio.Semaphore(max_concurrent) async def staggered_incremental(idx, gid, pid): - async with sem: - # 按索引交错延迟,均匀分散 API 压力 - if idx > 0 and stagger > 0: - await asyncio.sleep(stagger * idx) + # 按索引交错延迟,均匀分散 API 压力 + if idx > 0 and stagger > 0: + await asyncio.sleep(stagger * idx) + async with sem: result = ( await self._perform_incremental_analysis_for_group_with_timeout( gid, pid @@ -614,9 +614,10 @@ class AutoScheduler: sem = asyncio.Semaphore(max_concurrent) async def staggered_final_report(idx, gid, pid): + if idx > 0 and stagger > 0: + await asyncio.sleep(stagger * idx) + async with sem: - if idx > 0 and stagger > 0: - await asyncio.sleep(stagger * idx) return await self._perform_incremental_final_report_for_group_with_timeout( gid, pid )