diff --git a/app.py b/app.py index b0e828c..fd5b564 100644 --- a/app.py +++ b/app.py @@ -223,20 +223,16 @@ async def ws_logs(ws: WebSocket, container_id: str, tail: int = DEFAULT_TAIL, to container = None await asyncio.sleep(1.0) continue - finally: - try: - await ws.close() - except Exception: - pass - try: await ws.close() - except Exception: pass except WebSocketDisconnect: pass except Exception as e: try: await ws.send_text(f"ERROR: {e}") except Exception: pass - try: await ws.close() - except Exception: pass + finally: + try: + await ws.close() + except Exception: + pass if __name__ == "__main__": import uvicorn