fix: api settings

This commit is contained in:
Gabe
2025-09-03 12:16:41 +08:00
parent 86f8d9694d
commit 17c8d198c3
3 changed files with 19 additions and 9 deletions

View File

@@ -1,3 +1,9 @@
import {
DEFAULT_BATCH_INTERVAL,
DEFAULT_BATCH_SIZE,
DEFAULT_BATCH_LENGTH,
} from "../../config";
/**
* 批处理队列
* @param {*} args
@@ -6,7 +12,11 @@
*/
const batchQueue = (
{ taskFn, ...args },
{ batchInterval = 1000, batchSize = 10, batchLength = 10000 } = {}
{
batchInterval = DEFAULT_BATCH_INTERVAL,
batchSize = DEFAULT_BATCH_SIZE,
batchLength = DEFAULT_BATCH_LENGTH,
} = {}
) => {
const queue = [];
let isProcessing = false;