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,