Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -128,7 +128,7 @@ async def send_chunked_data(websocket: WebSocket, filename: str, data: str):
|
|
128 |
chunk_size = 1024 # Set an appropriate chunk size
|
129 |
for i in range(0, len(data), chunk_size):
|
130 |
await websocket.send_json({"filename": filename, "data_chunk": data[i:i + chunk_size]})
|
131 |
-
await asyncio.sleep(
|
132 |
await websocket.send_text("FinishedThisAttachment")
|
133 |
|
134 |
|
@@ -225,7 +225,6 @@ async def test_websocket(websocket: WebSocket):
|
|
225 |
print(len(messages))
|
226 |
await websocket.send_json({"total_messages":len(messages)})
|
227 |
await websocket.send_text("CompletedSendingTotalMessagesLength")
|
228 |
-
await asyncio.sleep(3.0)
|
229 |
attachments = []
|
230 |
prev_data=""
|
231 |
data_new={}
|
|
|
128 |
chunk_size = 1024 # Set an appropriate chunk size
|
129 |
for i in range(0, len(data), chunk_size):
|
130 |
await websocket.send_json({"filename": filename, "data_chunk": data[i:i + chunk_size]})
|
131 |
+
await asyncio.sleep(0.4)
|
132 |
await websocket.send_text("FinishedThisAttachment")
|
133 |
|
134 |
|
|
|
225 |
print(len(messages))
|
226 |
await websocket.send_json({"total_messages":len(messages)})
|
227 |
await websocket.send_text("CompletedSendingTotalMessagesLength")
|
|
|
228 |
attachments = []
|
229 |
prev_data=""
|
230 |
data_new={}
|