Browse Source

FIX double-encoding of json

boyska 2 years ago
parent
commit
4e9abf81b8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pizzicore/pizzicore.py

+ 1 - 1
pizzicore/pizzicore.py

@@ -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)