optimize fetchpool
This commit is contained in:
@@ -3,10 +3,9 @@ import ReactDOM from "react-dom/client";
|
||||
import Action from "./views/Action";
|
||||
import createCache from "@emotion/cache";
|
||||
import { CacheProvider } from "@emotion/react";
|
||||
|
||||
import { fetchUpdate } from "./libs/fetch";
|
||||
import { getRules, matchRule } from "./libs";
|
||||
import { getSetting } from "./libs";
|
||||
import { transPool } from "./libs/pool";
|
||||
import { Translator } from "./libs/translator";
|
||||
|
||||
/**
|
||||
@@ -35,7 +34,7 @@ import { Translator } from "./libs/translator";
|
||||
|
||||
// 翻译页面
|
||||
const { fetchInterval, fetchLimit } = await getSetting();
|
||||
transPool.update(fetchInterval, fetchLimit);
|
||||
fetchUpdate(fetchInterval, fetchLimit);
|
||||
const rules = await getRules();
|
||||
const rule = matchRule(rules, document.location.href);
|
||||
const translator = new Translator(rule);
|
||||
|
||||
Reference in New Issue
Block a user