fix: catch sse exceptions (#1971)
This commit is contained in:
parent
2971b571bc
commit
5c5dd98af2
1 changed files with 3 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue