perf: async read file (#4978)

* perf: async read file

* package

* doc
This commit is contained in:
Archer
2025-06-08 18:46:36 +08:00
committed by GitHub
parent 188008255d
commit 7494ce8453
9 changed files with 36 additions and 32 deletions

View File

@@ -103,7 +103,7 @@ export const loadSystemModels = async (init = false) => {
// Load system model from local
const modelsPath = getModelConfigBaseUrl();
const providerList = fs.readdirSync(modelsPath) as string[];
const providerList = await fs.promises.readdir(modelsPath);
await Promise.all(
providerList.map(async (name) => {
const fileContent = (await import(`./provider/${name}`))?.default as {