This commit is contained in:
anlicheng 2025-08-03 01:31:38 +08:00
parent c8f1787ea2
commit 2d6adba8a8

View File

@ -100,13 +100,19 @@ actor SDLSuperClient {
// --MARK: // --MARK:
group.addTask { group.addTask {
while true { while true {
try Task.checkCancellation()
//await self.ping() do {
try Task.checkCancellation()
try await Task.sleep(nanoseconds: 5 * 1_000_000_000) try Task.checkCancellation()
try Task.checkCancellation() //await self.ping()
try Task.checkCancellation()
try await Task.sleep(nanoseconds: 5 * 1_000_000_000)
try Task.checkCancellation()
} catch let err {
NSLog("[SDLSuperClient] heartbeat cancelled")
throw err
}
} }
NSLog("[SDLSuperClient] heartbeat cancelled")
} }
try await group.waitForAll() try await group.waitForAll()