refactor: use while settings.lnbits_running instead of while True

This commit is contained in:
Vlad Stan
2025-07-15 11:14:04 +02:00
committed by dni ⚡
parent ba0f7a01ef
commit 9aa2194d94
3 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -7,6 +7,8 @@ from typing import TYPE_CHECKING, NamedTuple
from loguru import logger
from lnbits.settings import settings
if TYPE_CHECKING:
from lnbits.nodes.base import Node
@@ -139,7 +141,7 @@ class Wallet(ABC):
pass
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
while True:
while settings.lnbits_running:
for invoice in self.pending_invoices:
try:
status = await self.get_invoice_status(invoice)
+1 -1
View File
@@ -236,7 +236,7 @@ class BoltzWallet(Wallet):
return PaymentFailedStatus()
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
while True:
while settings.lnbits_running:
try:
request = boltzrpc_pb2.GetSwapInfoRequest()
info: boltzrpc_pb2.GetSwapInfoResponse
+1 -1
View File
@@ -277,7 +277,7 @@ else:
return PaymentPendingStatus()
async def paid_invoices_stream(self) -> AsyncGenerator[str, None]:
while True:
while settings.lnbits_running:
event = await breez_event_queue.get()
if event.is_invoice_paid():
yield event.details.payment_hash