()
| 85 | * @returns 返回当前队列状态对象 |
| 86 | */ |
| 87 | export function getQueueStatus() { |
| 88 | const maxConcurrent = getMaxConcurrentTranslations(); |
| 89 | return { |
| 90 | activeTranslations, |
| 91 | pendingTranslations: pendingTranslations.length, |
| 92 | maxConcurrent: maxConcurrent, |
| 93 | isQueueFull: activeTranslations >= maxConcurrent, |
| 94 | totalTasksInProcess: activeTranslations + pendingTranslations.length |
| 95 | }; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * 检查是否可以添加更多任务 |
no test coverage detected