Omkar008 commited on
Commit
edc454d
1 Parent(s): ffa92da

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +3 -1
test.py CHANGED
@@ -136,7 +136,9 @@ async def send_chunked_data(websocket: WebSocket, filename: str, data: str):
136
  chunk_size = 1024 # Set an appropriate chunk size
137
  for i in range(0, len(data), chunk_size):
138
  await websocket.send_json({"filename": filename, "data_chunk": data[i:i + chunk_size]})
139
- await asyncio.sleep(0.1)
 
 
140
 
141
  @app.websocket("/ws")
142
  async def test_websocket(websocket: WebSocket):
 
136
  chunk_size = 1024 # Set an appropriate chunk size
137
  for i in range(0, len(data), chunk_size):
138
  await websocket.send_json({"filename": filename, "data_chunk": data[i:i + chunk_size]})
139
+ await asyncio.sleep(0.1)
140
+ await websocket.send_text("FinishedThisAttachment")
141
+
142
 
143
  @app.websocket("/ws")
144
  async def test_websocket(websocket: WebSocket):