From 2a60ff9491c38b67ae9fde3c77d2db47d808f206 Mon Sep 17 00:00:00 2001 From: Avraham Sakal Date: Fri, 3 Jan 2025 13:44:56 -0500 Subject: [PATCH] adjustable concurrency --- ingest-option-quotes.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ingest-option-quotes.ts b/ingest-option-quotes.ts index a879027..a081527 100644 --- a/ingest-option-quotes.ts +++ b/ingest-option-quotes.ts @@ -8,12 +8,13 @@ dotenv.config(); const env = new Env(); const POLYGON_API_KEY = env.require("POLYGON_API_KEY"); +const CONCURRENCY = Number.parseInt(env.get("CONCURRENCY", "6")); const polygon = restClient(POLYGON_API_KEY, "https://api.polygon.io", { pagination: true, }); -const queue = new PQueue({ concurrency: 6 }); +const queue = new PQueue({ concurrency: CONCURRENCY }); function* dateRange( startDateStr: string,