[perf] Faster require invoice key (#3603)

This commit is contained in:
Vlad Stan
2025-12-05 10:03:51 +02:00
committed by GitHub
parent d9b045c526
commit 850087a8ec
14 changed files with 175 additions and 40 deletions
+5
View File
@@ -37,6 +37,7 @@ from lnbits.decorators import (
require_invoice_key,
)
from lnbits.helpers import generate_filter_params_openapi
from lnbits.utils.cache import cache
from ..crud import (
delete_wallet,
@@ -133,6 +134,10 @@ async def api_reset_wallet_keys(
if not wallet or wallet.user != account_id.id:
raise HTTPException(status_code=HTTPStatus.NOT_FOUND, detail="Wallet not found")
cache.pop(f"auth:wallet:{wallet.id}")
cache.pop(f"auth:x-api-key:{wallet.adminkey}")
cache.pop(f"auth:x-api-key:{wallet.inkey}")
wallet.adminkey = uuid4().hex
wallet.inkey = uuid4().hex
await update_wallet(wallet)