Add web auth, infinite-scroll, agent admission and review fixes across agent/server/web
This commit is contained in:
@@ -208,9 +208,16 @@ async def tick(
|
||||
await session.commit()
|
||||
if not rows:
|
||||
return 0
|
||||
await asyncio.gather(
|
||||
*(_process_row(sm, registry, r, settings.notifier_max_attempts) for r in rows)
|
||||
)
|
||||
|
||||
# Bound concurrent DB sessions: each _process_row opens its own session, so an
|
||||
# unbounded gather over a large batch can exhaust the connection pool.
|
||||
sem = asyncio.Semaphore(settings.notifier_concurrency)
|
||||
|
||||
async def _guarded(row: dict) -> None:
|
||||
async with sem:
|
||||
await _process_row(sm, registry, row, settings.notifier_max_attempts)
|
||||
|
||||
await asyncio.gather(*(_guarded(r) for r in rows))
|
||||
return len(rows)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user