mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Merge pull request #1743 from ahoppen/withtimeout-issue
This commit is contained in:
@@ -26,7 +26,6 @@ package func repeatUntilExpectedResult(
|
||||
file: StaticString = #filePath,
|
||||
line: UInt = #line
|
||||
) async throws {
|
||||
logger.info("x: \(Int(timeout.seconds / sleepInterval.seconds))")
|
||||
for _ in 0..<Int(timeout.seconds / sleepInterval.seconds) {
|
||||
if try await body() {
|
||||
return
|
||||
|
||||
@@ -189,8 +189,8 @@ package func withTimeout<T: Sendable>(
|
||||
|
||||
let timeoutTask = Task {
|
||||
try await Task.sleep(for: duration)
|
||||
bodyTask.cancel()
|
||||
continuation.yield(with: .failure(TimeoutError()))
|
||||
bodyTask.cancel()
|
||||
}
|
||||
mutableTasks = [bodyTask, timeoutTask]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user