WebChat: make tunnel restart handler hop to MainActor
This commit is contained in:
1 parent
3377bd4ae5
commit
40c8e4832a
1 file changed
+2
-3
@@ -134,11 +134,10 @@ final class WebChatWindowController: NSWindowController, WKNavigationDelegate {
|
||||
|
||||
// Auto-restart on unexpected termination while window lives
|
||||
tunnel.process.terminationHandler = { [weak self] _ in
|
||||
guard let self else { return }
|
||||
guard self.tunnelRestartEnabled else { return }
|
||||
webChatLogger.error("webchat tunnel terminated; restarting")
|
||||
Task { @MainActor [weak self] in
|
||||
guard let self else { return }
|
||||
guard self.tunnelRestartEnabled else { return }
|
||||
webChatLogger.error("webchat tunnel terminated; restarting")
|
||||
do {
|
||||
// Recreate the tunnel silently so the window keeps working without user intervention.
|
||||
let base = try await self.startOrRestartTunnel()
|
||||
|
||||
Reference in new issue
Block a user