select for update
This commit is contained in:
parent
a111aaac46
commit
c7e316ab22
1 changed files with 5 additions and 4 deletions
|
@ -474,10 +474,11 @@ def removePeering(data):
|
|||
if len(data.get('id', '')) not in (16, 43):
|
||||
logger.debug('invalid user id')
|
||||
return {}
|
||||
u = models.User.get_or_create(data['id'])
|
||||
u.info['message'] = data.get('message', '')
|
||||
u.update_peering(False)
|
||||
state.nodes.peer_queue(u.id, 'peering', 'removePeering')
|
||||
u = models.User.get(data['id'], for_udpate=True)
|
||||
if u:
|
||||
u.info['message'] = data.get('message', '')
|
||||
u.update_peering(False)
|
||||
state.nodes.peer_queue(u.id, 'peering', 'removePeering')
|
||||
return {}
|
||||
actions.register(removePeering, cache=False)
|
||||
|
||||
|
|
Loading…
Reference in a new issue