mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 09:22:44 -05:00
refac
This commit is contained in:
1 parent
d77709357b
commit
eb4ff07b29
1 file changed
+4
-1
@@ -694,7 +694,8 @@ async def _proxy_terminal_websocket(
|
||||
elif 'text' in msg and msg['text']:
|
||||
await upstream.send_str(msg['text'])
|
||||
except Exception:
|
||||
pass
|
||||
with suppress(Exception):
|
||||
await ws.close(code=1011, reason='Terminal connection interrupted. Reconnecting.')
|
||||
|
||||
async def _upstream_to_client():
|
||||
"""Forward upstream → client."""
|
||||
@@ -724,6 +725,8 @@ async def _proxy_terminal_websocket(
|
||||
return
|
||||
except Exception:
|
||||
log.exception('Terminal access recheck failed')
|
||||
with suppress(Exception):
|
||||
await ws.close(code=1011, reason='Terminal access check unavailable. Reconnecting.')
|
||||
|
||||
# End the proxy as soon as any task finishes (e.g. a
|
||||
# graceful upstream CLOSE) and cancel the rest, which would
|
||||
|
||||
Reference in new issue
Block a user