fix default interval

This commit is contained in:
Gabe Yuan
2023-08-06 22:31:42 +08:00
parent 8fd6085a09
commit 05e303f293
26 changed files with 30 additions and 30 deletions

View File

@@ -120,7 +120,7 @@ export const OPT_STYLE_ALL = [
];
export const DEFAULT_FETCH_LIMIT = 10; // 默认最大任务数量
export const DEFAULT_FETCH_INTERVAL = 500; // 默认任务间隔时间
export const DEFAULT_FETCH_INTERVAL = 100; // 默认任务间隔时间
export const PROMPT_PLACE_FROM = "{{from}}"; // 占位符
export const PROMPT_PLACE_TO = "{{to}}"; // 占位符

View File

@@ -6,7 +6,7 @@ import {
import { apiTranslate } from "../apis";
import { msAuth } from "./auth";
const _taskPool = (fn, preFn, _interval = 500, _limit = 100) => {
const _taskPool = (fn, preFn, _interval = 100, _limit = 100) => {
const pool = [];
const maxRetry = 2; // 最大重试次数
let maxCount = _limit; // 最大数量
@@ -56,7 +56,7 @@ const _taskPool = (fn, preFn, _interval = 500, _limit = 100) => {
pool.push({ args, resolve, reject, retry: 0 });
});
},
update: (_interval = 500, _limit = 100) => {
update: (_interval = 100, _limit = 100) => {
if (_interval >= 0 && _interval <= 5000 && _interval !== interval) {
interval = _interval;
}