import pLimit from "p-limit"; import os from 'os'; const cronLimit = pLimit(os.cpus.length); export function runCronWithLimit(fn: () => Promise): Promise { return cronLimit(() => { return fn(); }); }