()
| 240 | const MIN_STAGE_TIME = 1000 |
| 241 | |
| 242 | const processQueue = async () => { |
| 243 | if (isProcessing) return |
| 244 | isProcessing = true |
| 245 | |
| 246 | while (queue.length > 0) { |
| 247 | const next = queue[0] |
| 248 | |
| 249 | if (next.stage !== currentStage) { |
| 250 | const elapsed = Date.now() - lastStageTime |
| 251 | if (elapsed < MIN_STAGE_TIME) { |
| 252 | await new Promise((resolve) => setTimeout(resolve, MIN_STAGE_TIME - elapsed)) |
| 253 | } |
| 254 | currentStage = next.stage |
| 255 | lastStageTime = Date.now() |
| 256 | } |
| 257 | |
| 258 | importProgress.value = queue.shift()! |
| 259 | } |
| 260 | isProcessing = false |
| 261 | } |
| 262 | |
| 263 | const importResult = await useImportService().importFile(filePath, undefined, (progress) => { |
| 264 | if (progress.stage === 'done') return |
no test coverage detected