mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 18:11:30 +01:00
added try for return
This commit is contained in:
parent
2f08255e92
commit
152991fbec
@ -731,11 +731,19 @@ async def websocket_connect(websocket: WebSocket, item_id: str):
|
||||
|
||||
@core_app.post("/api/v1/ws/{item_id}")
|
||||
async def websocket_update(item_id: str, data: str):
|
||||
await updater(item_id, data)
|
||||
try:
|
||||
await updater(item_id, data)
|
||||
return {"sent": True, "data": data}
|
||||
except:
|
||||
return {"sent": False, "data": data}
|
||||
|
||||
@core_app.get("/api/v1/ws/{item_id}/{data}")
|
||||
async def websocket_update(item_id: str, data: str):
|
||||
await updater(item_id, data)
|
||||
try:
|
||||
await updater(item_id, data)
|
||||
return {"sent": True, "data": data}
|
||||
except:
|
||||
return {"sent": False, "data": data}
|
||||
|
||||
async def updater(item_id, data):
|
||||
return await manager.send_data(
|
||||
|
Loading…
Reference in New Issue
Block a user