mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 06:40:45 +08:00
Adopt production-safe runtime defaults and forwarder retry limits.
Lower CLI/WebCRT/audit caps, log startup capacity warnings, and bound oclaw requeues so reconnect storms cannot thrash memory. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
d56020d84c
commit
fa577aa3bd
22 changed files with 238 additions and 69 deletions
|
|
@ -43,7 +43,7 @@ def _pool_for_cycle(cycle_id: str, concurrency: int) -> ThreadPoolExecutor:
|
|||
with _pools_lock:
|
||||
pool = _pools.get(cycle_id)
|
||||
if pool is None:
|
||||
workers = clamp_cli_workers(int(concurrency or 5), hard_cap=30)
|
||||
workers = clamp_cli_workers(int(concurrency or 5))
|
||||
pool = ThreadPoolExecutor(max_workers=workers, thread_name_prefix=f"cfg-sync-{cycle_id[:8]}")
|
||||
_pools[cycle_id] = pool
|
||||
return pool
|
||||
|
|
@ -462,7 +462,7 @@ def dispatch_cycle(cycle_id: str) -> int:
|
|||
.all()
|
||||
)
|
||||
task_ids = [str(t.id) for t in pending]
|
||||
concurrency = max(1, min(30, int(cycle.concurrency or 5)))
|
||||
concurrency = max(1, min(16, int(cycle.concurrency or 5)))
|
||||
finally:
|
||||
db.close()
|
||||
return schedule_cycle_tasks(cycle_id, task_ids, concurrency)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue