mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复获取 cpu 核数
This commit is contained in:
parent
f7465759c7
commit
0bbb7c7b89
|
@ -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<T>(fn: () => Promise<T>): Promise<T> {
|
||||
return cronLimit(() => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user