adjustable concurrency

This commit is contained in:
Avraham Sakal
2025-01-03 13:44:56 -05:00
parent ef2185af3b
commit 2a60ff9491
+2 -1
View File
@@ -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,