Make maxConcurrentReqs configurable (#1341)

This commit is contained in:
jackyzy823 2025-12-08 17:05:08 +08:00 committed by GitHub
commit baeaf685d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View file

@ -3,14 +3,17 @@ import std/[asyncdispatch, times, json, random, strutils, tables, packedsets, os
import types, consts
import experimental/parser/session
# max requests at a time per session to avoid race conditions
const
maxConcurrentReqs = 2
hourInSeconds = 60 * 60
const hourInSeconds = 60 * 60
var
sessionPool: seq[Session]
enableLogging = false
# max requests at a time per session to avoid race conditions
maxConcurrentReqs = 2
proc setMaxConcurrentReqs*(reqs: int) =
if reqs > 0:
maxConcurrentReqs = reqs
template log(str: varargs[string, `$`]) =
echo "[sessions] ", str.join("")