From 0bbb7c7b8947085fac1d9ed758216017c79c5a07 Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 30 May 2023 17:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=20cpu=20?= =?UTF-8?q?=E6=A0=B8=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/shared/pLimit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/shared/pLimit.ts b/back/shared/pLimit.ts index 5af4313e..b1e4730e 100644 --- a/back/shared/pLimit.ts +++ b/back/shared/pLimit.ts @@ -1,7 +1,7 @@ import pLimit from "p-limit"; import os from 'os'; -const cronLimit = pLimit(os.cpus.length || 3); +const cronLimit = pLimit(os.cpus().length); export function runCronWithLimit(fn: () => Promise): Promise { return cronLimit(() => {