mirror of
https://github.com/germondai/trawl.git
synced 2026-08-17 12:11:23 +02:00
feat(api): add BROWSER_CONTENT_PROCESSES env var
This commit is contained in:
@@ -22,6 +22,10 @@ const POOL_SIZE = Number(process.env.BROWSER_POOL_SIZE ?? "3")
|
||||
const ACQUIRE_TIMEOUT_MS = Number(process.env.BROWSER_ACQUIRE_TIMEOUT_MS ?? "15000")
|
||||
const SESSION_TTL = Number(process.env.SESSION_TTL_SECONDS ?? "3600")
|
||||
const RECYCLE_AFTER_TEMPORARY_CONTEXTS = Number(process.env.BROWSER_RECYCLE_AFTER_CONTEXTS ?? "8")
|
||||
// Caps Firefox content processes per browser. Default `2` keeps thread/RAM footprint
|
||||
// minimal while still allowing CF/Imperva challenges to resolve. Raise if specific
|
||||
// targets fail with empty content (rare).
|
||||
const CONTENT_PROCESSES = Number(process.env.BROWSER_CONTENT_PROCESSES ?? "2")
|
||||
|
||||
// PROXY_URL / RESIDENTIAL_PROXY_URL accept a comma-separated list of proxy URLs (a single
|
||||
// URL still works — it's just a 1-element list). *_LIST_FILE is an alternative source
|
||||
@@ -55,6 +59,7 @@ async function initPool() {
|
||||
poolSize: POOL_SIZE,
|
||||
acquireTimeoutMs: ACQUIRE_TIMEOUT_MS,
|
||||
recycleAfterTemporaryContexts: RECYCLE_AFTER_TEMPORARY_CONTEXTS,
|
||||
contentProcesses: CONTENT_PROCESSES,
|
||||
})
|
||||
await pool.init()
|
||||
pool.startHealthCheck()
|
||||
|
||||
Reference in New Issue
Block a user