MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / processQueue

Function processQueue

entrypoints/utils/translateQueue.ts:60–71  ·  view source on GitHub ↗

* 处理队列中的下一个任务

()

Source from the content-addressed store, hash-verified

58 * 处理队列中的下一个任务
59 */
60function processQueue() {
61 // 如果有等待的任务,并且活跃任务数量未达到上限,执行下一个任务
62 if (pendingTranslations.length > 0 && activeTranslations < getMaxConcurrentTranslations()) {
63 const nextTask = pendingTranslations.shift();
64 if (nextTask) {
65 activeTranslations++;
66 nextTask().catch(() => {
67 // 错误已在任务内部处理,这里仅防止未捕获的Promise异常
68 });
69 }
70 }
71}
72
73/**
74 * 清空翻译队列

Callers 1

taskWrapperFunction · 0.85

Calls 1

Tested by

no test coverage detected