diff --git a/Sources/SemanticIndex/TaskScheduler.swift b/Sources/SemanticIndex/TaskScheduler.swift index e9b1c3a9d..533197fba 100644 --- a/Sources/SemanticIndex/TaskScheduler.swift +++ b/Sources/SemanticIndex/TaskScheduler.swift @@ -459,7 +459,8 @@ package actor TaskScheduler { /// After `shutDown` has been called, no more tasks will be executed on this `TaskScheduler`. package func shutDown() async { self.isShutDown = true - await self.currentlyExecutingTasks.concurrentForEach { task in + let allTasks = self.currentlyExecutingTasks + self.pendingTasks + await allTasks.concurrentForEach { task in task.cancel() do { try await withTimeout(.seconds(10)) {