mirror of
https://github.com/lnbits/lnbits.git
synced 2025-03-30 04:32:01 +02:00
feat: remove autofix (#2359)
This commit is contained in:
parent
1bf5f10f53
commit
10fe113099
@ -234,14 +234,12 @@ async def database_cleanup_accounts(days: Optional[int] = None):
|
|||||||
@click.option("-d", "--days", help="Maximum age of payments in days.")
|
@click.option("-d", "--days", help="Maximum age of payments in days.")
|
||||||
@click.option("-l", "--limit", help="Maximum number of payments to be checked.")
|
@click.option("-l", "--limit", help="Maximum number of payments to be checked.")
|
||||||
@click.option("-w", "--wallet", help="Only check for this wallet.")
|
@click.option("-w", "--wallet", help="Only check for this wallet.")
|
||||||
@click.option("-a", "--auto-fix", is_flag=True, help="Set invalid payments to pending.")
|
|
||||||
@click.option("-v", "--verbose", is_flag=True, help="Detailed log.")
|
@click.option("-v", "--verbose", is_flag=True, help="Detailed log.")
|
||||||
@coro
|
@coro
|
||||||
async def check_invalid_payments(
|
async def check_invalid_payments(
|
||||||
days: Optional[int] = None,
|
days: Optional[int] = None,
|
||||||
limit: Optional[int] = None,
|
limit: Optional[int] = None,
|
||||||
wallet: Optional[str] = None,
|
wallet: Optional[str] = None,
|
||||||
auto_fix: Optional[bool] = False,
|
|
||||||
verbose: Optional[bool] = False,
|
verbose: Optional[bool] = False,
|
||||||
):
|
):
|
||||||
"""Check payments that are settled in the DB but pending on the Funding Source"""
|
"""Check payments that are settled in the DB but pending on the Funding Source"""
|
||||||
@ -315,22 +313,6 @@ async def check_invalid_payments(
|
|||||||
data = invalid_wallets[f"{w}"]
|
data = invalid_wallets[f"{w}"]
|
||||||
click.echo(" ".join([w, str(data[0]), str(data[1] / 1000).ljust(10)]))
|
click.echo(" ".join([w, str(data[0]), str(data[1] / 1000).ljust(10)]))
|
||||||
|
|
||||||
if auto_fix:
|
|
||||||
click.echo(f"Auto fixing '{str(len(invalid_payments))}' Payments.")
|
|
||||||
for i_p in invalid_payments:
|
|
||||||
if verbose:
|
|
||||||
click.echo(f" payment: {i_p.checking_id}")
|
|
||||||
if i_p.amount < 0 or i_p.checking_id.startswith("service_fee"):
|
|
||||||
click.echo(
|
|
||||||
f" payment skipped: {i_p.checking_id}, amoumt: {i_p.amount}"
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
async with core_db.connect() as conn:
|
|
||||||
await update_payment_status(
|
|
||||||
pending=True, checking_id=i_p.checking_id, conn=conn
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def load_disabled_extension_list() -> None:
|
async def load_disabled_extension_list() -> None:
|
||||||
"""Update list of extensions that have been explicitly disabled"""
|
"""Update list of extensions that have been explicitly disabled"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user