From 8e62d9287d3c44d85467a3024f0f95a446343ee5 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 21 Mar 2021 17:59:54 -0300 Subject: [PATCH] actually repeat the check once every 5 minutes just to be sure. also because the stream doesn't cover outgoing payments. --- lnbits/tasks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lnbits/tasks.py b/lnbits/tasks.py index ca3d9d67..77f55fc9 100644 --- a/lnbits/tasks.py +++ b/lnbits/tasks.py @@ -66,9 +66,12 @@ async def invoice_listener(nursery): async def check_pending_payments(): await delete_expired_invoices() - for payment in await get_payments(complete=False, pending=True, exclude_uncheckable=True): - print(" - checking pending", payment.checking_id) - await payment.check_pending() + while True: + for payment in await get_payments(complete=False, pending=True, exclude_uncheckable=True): + print(" - checking pending", payment.checking_id) + await payment.check_pending() + + await trio.sleep(60 * 5) async def invoice_callback_dispatcher(checking_id: str):