[P] Split rows into websocket-sendable messages
This commit is contained in:
@@ -55,7 +55,8 @@ async def websocket_endpoint(websocket: WebSocket, user_id: int):
|
|||||||
for i in jsonable_data:
|
for i in jsonable_data:
|
||||||
i['timestamp'] = i['timestamp'].strftime("%Y-%m-%dT%H:%M:%SZ")
|
i['timestamp'] = i['timestamp'].strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
|
||||||
await websocket.send_json(json.dumps(jsonable_data))
|
for i in jsonable_data:
|
||||||
|
await websocket.send_json(json.dumps([i]))
|
||||||
|
|
||||||
# receive forever
|
# receive forever
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user