mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-10 20:42:32 +02:00
fix: catch sse exceptions (#1971)
This commit is contained in:
@@ -478,8 +478,10 @@ async def subscribe_wallet_invoices(request: Request, wallet: Wallet):
|
|||||||
yield dict(data=payment.json(), event="payment-received")
|
yield dict(data=payment.json(), event="payment-received")
|
||||||
except asyncio.CancelledError:
|
except asyncio.CancelledError:
|
||||||
logger.debug(f"removing listener for wallet {uid}")
|
logger.debug(f"removing listener for wallet {uid}")
|
||||||
|
except Exception as exc:
|
||||||
|
logger.error(f"Error in sse: {exc}")
|
||||||
|
finally:
|
||||||
api_invoice_listeners.pop(uid)
|
api_invoice_listeners.pop(uid)
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
@api_router.get("/api/v1/payments/sse")
|
@api_router.get("/api/v1/payments/sse")
|
||||||
|
Reference in New Issue
Block a user