mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 15:19:32 +00:00
Make maxConcurrentReqs configurable (#1341)
This commit is contained in:
parent
51b54852dc
commit
baeaf685d3
5 changed files with 12 additions and 5 deletions
11
src/auth.nim
11
src/auth.nim
|
|
@ -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("")
|
||||
|
|
|
|||
Loading…
Reference in a new issue