|
|
@ -8,12 +8,13 @@ dotenv.config();
|
|
|
|
|
|
|
|
|
|
|
|
const env = new Env();
|
|
|
|
const env = new Env();
|
|
|
|
const POLYGON_API_KEY = env.require("POLYGON_API_KEY");
|
|
|
|
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", {
|
|
|
|
const polygon = restClient(POLYGON_API_KEY, "https://api.polygon.io", {
|
|
|
|
pagination: true,
|
|
|
|
pagination: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const queue = new PQueue({ concurrency: 6 });
|
|
|
|
const queue = new PQueue({ concurrency: CONCURRENCY });
|
|
|
|
|
|
|
|
|
|
|
|
function* dateRange(
|
|
|
|
function* dateRange(
|
|
|
|
startDateStr: string,
|
|
|
|
startDateStr: string,
|
|
|
|