forked from MarseyWorld/MarseyWorld
users: use with_for_update() in charge_account
parent
6d636e4e42
commit
d53c714bb7
|
@ -173,7 +173,7 @@ class User(Base):
|
|||
|
||||
|
||||
def charge_account(self, currency, amount):
|
||||
in_db = g.db.query(User).filter(User.id == self.id).one()
|
||||
in_db = g.db.query(User).filter(User.id == self.id).with_for_update().one()
|
||||
succeeded = False
|
||||
|
||||
if currency == 'coins':
|
||||
|
|
Loading…
Reference in New Issue