This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import PQueue from "p-queue"; | |
| import fetch, { Request, RequestInit, Response } from "node-fetch"; | |
| import { z } from "zod"; | |
| import { Temporal } from "@js-temporal/polyfill"; | |
| class HTTPError extends Error {} | |
| // be nice to the council: one request per second, never more than one at a time | |
| const queue = new PQueue({ concurrency: 1, interval: 5000, intervalCap: 5 }); |
OlderNewer