[perf] send payment notifications in background (#3588)

This commit is contained in:
Vlad Stan 2025-11-26 19:53:10 +02:00 committed by GitHub
parent 730ab59578
commit 5f1cfc0e37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View file

@ -298,7 +298,7 @@ async def test_retry_failed_invoice(
assert external_invoice.payment_request
ws_notification = mocker.patch(
"lnbits.core.services.payments.send_payment_notification",
"lnbits.core.services.payments.send_payment_notification_in_background",
AsyncMock(return_value=None),
)
@ -378,7 +378,7 @@ async def test_pay_external_invoice_pending(
AsyncMock(return_value=payment_reponse_pending),
)
ws_notification = mocker.patch(
"lnbits.core.services.payments.send_payment_notification",
"lnbits.core.services.payments.send_payment_notification_in_background",
AsyncMock(return_value=None),
)
wallet = await get_wallet(from_wallet.id)
@ -428,7 +428,7 @@ async def test_retry_pay_external_invoice_pending(
AsyncMock(return_value=payment_reponse_pending),
)
ws_notification = mocker.patch(
"lnbits.core.services.payments.send_payment_notification",
"lnbits.core.services.payments.send_payment_notification_in_background",
AsyncMock(return_value=None),
)
wallet = await get_wallet(from_wallet.id)
@ -474,7 +474,7 @@ async def test_pay_external_invoice_success(
AsyncMock(return_value=payment_reponse_pending),
)
ws_notification = mocker.patch(
"lnbits.core.services.payments.send_payment_notification",
"lnbits.core.services.payments.send_payment_notification_in_background",
AsyncMock(return_value=None),
)
wallet = await get_wallet(from_wallet.id)
@ -520,7 +520,7 @@ async def test_retry_pay_success(
AsyncMock(return_value=payment_reponse_pending),
)
ws_notification = mocker.patch(
"lnbits.core.services.payments.send_payment_notification",
"lnbits.core.services.payments.send_payment_notification_in_background",
AsyncMock(return_value=None),
)
wallet = await get_wallet(from_wallet.id)