Skip to content

Commit

Permalink
Fixes an issue that was causing 100% cpu usage in 1.78.0 (#2371)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1177771139624306/1206806923660057/f

## Description

Fixes an issue that was causing CPU usage to reach 100%.
  • Loading branch information
diegoreymendez authored Mar 11, 2024
1 parent 008df5d commit fa028d8
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ public final class TunnelControllerIPCClient {
xpc.onDisconnect = { [weak self] in
guard let self else { return }

// By calling register we make sure that XPC will connect as soon as it
// becomes available again, as requests are queued. This helps ensure
// that the client app will always be connected to XPC.
self.register()
Task { @MainActor in
try await Task.sleep(interval: .seconds(1))

// By calling register we make sure that XPC will connect as soon as it
// becomes available again, as requests are queued. This helps ensure
// that the client app will always be connected to XPC.
self.register()
}
}
}
}
Expand Down

0 comments on commit fa028d8

Please sign in to comment.