From d757154125b56c2ff6bb07256605f10872ab0e30 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:27:37 +0300 Subject: [PATCH] print time of expiration (#952) --- lnbits/core/crud.py | 4 +++- lnbits/tasks.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index cba41f60..c54d3c18 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -336,7 +336,9 @@ async def delete_expired_invoices( expiration_date = datetime.datetime.fromtimestamp(invoice.date + invoice.expiry) if expiration_date > datetime.datetime.utcnow(): continue - logger.debug(f"Deleting expired invoice: {invoice.payment_hash}") + logger.debug( + f"Deleting expired invoice: {invoice.payment_hash} (expired: {expiration_date})" + ) await (conn or db).execute( """ DELETE FROM apipayments diff --git a/lnbits/tasks.py b/lnbits/tasks.py index be50d6c5..078edca1 100644 --- a/lnbits/tasks.py +++ b/lnbits/tasks.py @@ -102,12 +102,11 @@ async def check_pending_payments(): exclude_uncheckable=True, conn=conn, ) - logger.debug(f"Task: checking {len(pending_payments)} pending payments") for payment in pending_payments: await payment.check_status() logger.debug( - f"Task: pending payments check finished (took {time.time() - start_time:0.3f} s)" + f"Task: pending check finished for {len(pending_payments)} payments (took {time.time() - start_time:0.3f} s)" ) # we delete expired invoices once upon the first pending check if incoming: