mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-19 20:14:59 +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")
|
||||
except asyncio.CancelledError:
|
||||
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)
|
||||
return
|
||||
|
||||
|
||||
@api_router.get("/api/v1/payments/sse")
|
||||
|
Reference in New Issue
Block a user