FIX double-encoding of json

This commit is contained in:
boyska 2021-09-24 00:53:30 +02:00
parent 6ce715c761
commit 4e9abf81b8

View file

@ -138,7 +138,7 @@ async def websocket_counter(websocket: WebSocket, cid: int):
while True:
try:
val = counter_store.get(cid)
await websocket.send_json(Value(counter=cid, value=val).json())
await websocket.send_json(jsonable_encoder(Value(counter=cid, value=val)))
except WebSocketDisconnect:
logging.debug("client disconnected")
manager.unsubscribe(cid, q)