ruff check

This commit is contained in:
Kyle
2025-08-08 23:35:55 -04:00
parent a85d7157a3
commit 8bb2191fcc
+2 -2
View File
@@ -277,12 +277,12 @@ class TestmintWallet:
logger.info(f"TestmintWallet.credit_balance amount in msat: {amount_msat}")
# Credit the balance using atomic database update to prevent race conditions
from sqlmodel import update
from sqlmodel import col, update
# Use atomic update to avoid lost update problem in concurrent scenarios
stmt = (
update(ApiKey)
.where(ApiKey.hashed_key == key.hashed_key)
.where(col(ApiKey.hashed_key) == key.hashed_key)
.values(balance=ApiKey.balance + amount_msat)
)
await session.execute(stmt)