mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 03:57:29 +02:00
renamed for clarity
This commit is contained in:
@@ -713,15 +713,11 @@ class websocketConnectionManager:
|
||||
def disconnect(self, websocket: WebSocket):
|
||||
self.active_connections.remove(websocket)
|
||||
|
||||
async def send_personal_message(self, message: str, item_id: str):
|
||||
async def send_data(self, message: str, item_id: str):
|
||||
for connection in self.active_connections:
|
||||
if connection.id == item_id:
|
||||
await connection.send_text(message)
|
||||
|
||||
async def broadcast(self, message: str):
|
||||
for connection in self.active_connections:
|
||||
await connection.send_text(message)
|
||||
|
||||
manager = websocketConnectionManager()
|
||||
|
||||
@core_app.websocket("/api/v1/ws/{item_id}")
|
||||
@@ -738,6 +734,6 @@ async def websocket_endpoint(item_id: str, data: str):
|
||||
await updater(item_id, data)
|
||||
|
||||
async def updater(item_id, data):
|
||||
return await manager.send_personal_message(
|
||||
return await manager.send_data(
|
||||
f"{data}", item_id
|
||||
)
|
Reference in New Issue
Block a user