feat: cleanup-wallets cli command (#2176)

* feat: `cleanup-wallet` cli command
`lnbits-cli db cleanup-wallets` removes all wallets that never had an transaction.
this helps against spammers creating random wallets, eventually slowing down the db.
* add commands
* add to example env
* db_versions was used in app
* add delta as cli argument
* use days unit
* simplify cli argument name (cleanup_wallet_days -> days)!

---------

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
dni ⚡
2024-01-30 07:47:15 +01:00
committed by GitHub
co-authored by Vlad Stan Pavol Rusnak
parent e1bb2113ed
commit 1d2b939e06
4 changed files with 73 additions and 7 deletions
+1
View File
@@ -348,6 +348,7 @@ class EnvSettings(LNbitsSettings):
log_retention: str = Field(default="3 months")
server_startup_time: int = Field(default=time())
lnbits_extensions_deactivate_all: bool = Field(default=False)
cleanup_wallets_days: int = Field(default=90)
@property
def has_default_extension_path(self) -> bool: