Adds websocket for payments
This commit is contained in:
parent
f8058825d8
commit
c714a2641d
1 changed files with 2 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ from lnbits.tasks import SseListenersDict, register_invoice_listener
|
||||||
from . import db
|
from . import db
|
||||||
from .crud import get_balance_notify
|
from .crud import get_balance_notify
|
||||||
from .models import Payment
|
from .models import Payment
|
||||||
|
from .services import websocketUpdater
|
||||||
|
|
||||||
api_invoice_listeners: Dict[str, asyncio.Queue] = SseListenersDict(
|
api_invoice_listeners: Dict[str, asyncio.Queue] = SseListenersDict(
|
||||||
"api_invoice_listeners"
|
"api_invoice_listeners"
|
||||||
|
|
@ -37,6 +38,7 @@ async def wait_for_paid_invoices(invoice_paid_queue: asyncio.Queue):
|
||||||
logger.trace("received invoice paid event")
|
logger.trace("received invoice paid event")
|
||||||
# send information to sse channel
|
# send information to sse channel
|
||||||
await dispatch_api_invoice_listeners(payment)
|
await dispatch_api_invoice_listeners(payment)
|
||||||
|
await websocketUpdater(payment.wallet_id, payment)
|
||||||
|
|
||||||
# dispatch webhook
|
# dispatch webhook
|
||||||
if payment.webhook and not payment.webhook_status:
|
if payment.webhook and not payment.webhook_status:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue