diff --git a/.env.example b/.env.example index b5c9feb27..898f90bd6 100644 --- a/.env.example +++ b/.env.example @@ -38,8 +38,6 @@ LNBITS_SERVICE_FEE="0.0" LNBITS_RESERVE_FEE_MIN=2000 # value in percent LNBITS_RESERVE_FEE_PERCENT=1.0 -# check invoice expiry on every startup (can be slow on large instances) -STARTUP_INVOICE_EXPIRY_CHECK=True # Change theme LNBITS_SITE_TITLE="LNbits" diff --git a/lnbits/core/migrations.py b/lnbits/core/migrations.py index a67715854..04a145eb0 100644 --- a/lnbits/core/migrations.py +++ b/lnbits/core/migrations.py @@ -1,7 +1,9 @@ -from sqlalchemy.exc import OperationalError # type: ignore -from lnbits import bolt11 import datetime +from sqlalchemy.exc import OperationalError # type: ignore + +from lnbits import bolt11 + async def m000_create_migrations_table(db): await db.execute( diff --git a/lnbits/settings.py b/lnbits/settings.py index d08a9d45f..17fce293c 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -69,7 +69,6 @@ PREFER_SECURE_URLS = env.bool("LNBITS_FORCE_HTTPS", default=True) RESERVE_FEE_MIN = env.int("LNBITS_RESERVE_FEE_MIN", default=2000) RESERVE_FEE_PERCENT = env.float("LNBITS_RESERVE_FEE_PERCENT", default=1.0) SERVICE_FEE = env.float("LNBITS_SERVICE_FEE", default=0.0) -STARTUP_INVOICE_EXPIRY_CHECK = env.bool("STARTUP_INVOICE_EXPIRY_CHECK", default=True) try: LNBITS_COMMIT = ( diff --git a/lnbits/tasks.py b/lnbits/tasks.py index c24bffa9a..fd2af8090 100644 --- a/lnbits/tasks.py +++ b/lnbits/tasks.py @@ -15,7 +15,6 @@ from lnbits.core.crud import ( get_standalone_payment, ) from lnbits.core.services import redeem_lnurl_withdraw -from lnbits.settings import WALLET, STARTUP_INVOICE_EXPIRY_CHECK from .core import db @@ -144,7 +143,7 @@ async def check_pending_payments(): 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 and STARTUP_INVOICE_EXPIRY_CHECK: + if incoming: logger.debug("Task: deleting all expired invoices") start_time: float = time.time() await delete_expired_invoices(conn=conn)