clone3 commited on
Commit
fa03655
1 Parent(s): 02e7b61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -59,7 +59,10 @@ async def send_wss_request():
59
  # Receive the response
60
  response = await websocket.recv()
61
  print(f"Received: {response}")
62
-
 
 
 
63
  # Sleep for 30 minutes before the next iteration
64
  await asyncio.sleep(30 * 60)
65
 
 
59
  # Receive the response
60
  response = await websocket.recv()
61
  print(f"Received: {response}")
62
+
63
+ except websockets.exceptions.ConnectionClosed:
64
+ print("Connection closed. Reconnecting in 30 minutes.")
65
+
66
  # Sleep for 30 minutes before the next iteration
67
  await asyncio.sleep(30 * 60)
68