cleanupRoutine 清理协程
()
| 508 | |
| 509 | // cleanupRoutine 清理协程 |
| 510 | func (tm *FileTaskManager) cleanupRoutine() { |
| 511 | for { |
| 512 | select { |
| 513 | case taskID := <-tm.cleanupChan: |
| 514 | _ = tm.CleanupTask(taskID) |
| 515 | case <-time.After(1 * time.Hour): |
| 516 | // 定期清理完成的任务 |
| 517 | tm.cleanupCompletedTasks() |
| 518 | } |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | // cleanupCompletedTasks 清理完成的任务 |
| 523 | func (tm *FileTaskManager) cleanupCompletedTasks() { |
no test coverage detected