mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 06:46:09 +08:00
修复获取 cpu 核数
This commit is contained in:
parent
f7465759c7
commit
0bbb7c7b89
|
@ -1,7 +1,7 @@
|
||||||
import pLimit from "p-limit";
|
import pLimit from "p-limit";
|
||||||
import os from 'os';
|
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> {
|
export function runCronWithLimit<T>(fn: () => Promise<T>): Promise<T> {
|
||||||
return cronLimit(() => {
|
return cronLimit(() => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user