A tool for tailing a labelers' firehose, rehydrating, and storing records for future analysis of moderation decisions.
at main 391 B view raw
1import { pRateLimit } from "p-ratelimit"; // TypeScript 2 3// create a rate limiter that allows up to 30 API calls per second, 4// with max concurrency of 10 5 6export const limit = pRateLimit({ 7 interval: 30000, // 1000 ms == 1 second 8 rate: 280, // 30 API calls per interval 9 concurrency: 48, // no more than 10 running at once 10 maxDelay: 0, // an API call delayed > 30 sec is rejected 11});