optimize fetchpool

This commit is contained in:
Gabe Yuan
2023-08-10 11:55:40 +08:00
parent 1c240d6edd
commit 69b5c4ff22
8 changed files with 104 additions and 71 deletions

View File

@@ -6,7 +6,7 @@ import {
} from "./config";
import { getRules, matchRule } from "./libs";
import { getSetting } from "./libs";
import { transPool } from "./libs/pool";
import { fetchUpdate } from "./libs/fetch";
import { Translator } from "./libs/translator";
/**
@@ -14,7 +14,7 @@ import { Translator } from "./libs/translator";
*/
(async () => {
const { fetchInterval, fetchLimit } = await getSetting();
transPool.update(fetchInterval, fetchLimit);
fetchUpdate(fetchInterval, fetchLimit);
const rules = await getRules();
const rule = matchRule(rules, document.location.href);