mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 02:54:37 +00:00
ruff check
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user