Properly short-circuit OSF member lookup loop
When iterating over Gerrit E-mail addresses to find a matching OSF member Id, stop once one is found. That was the original intent, but a continue was used instead of a break within the conditional causing (perhaps very many) unnecessary additional queries against the member lookup API. Change-Id: I025170b726c2edd9dcb4996de99eb541b4e8abcf
This commit is contained in:
parent
6c9f07f7a2
commit
54d0a77b94
@ -487,7 +487,7 @@ def main(options):
|
|||||||
member = utils.lookup_member(email)
|
member = utils.lookup_member(email)
|
||||||
if member['data']:
|
if member['data']:
|
||||||
owners[owner]['member'] = member['data'][0]['id']
|
owners[owner]['member'] = member['data'][0]['id']
|
||||||
continue
|
break
|
||||||
invite = [owners[owner].get('member', '0')]
|
invite = [owners[owner].get('member', '0')]
|
||||||
invite.append(owners[owner]['name'].encode('utf-8'))
|
invite.append(owners[owner]['name'].encode('utf-8'))
|
||||||
invite.append(owners[owner]['preferred'])
|
invite.append(owners[owner]['preferred'])
|
||||||
|
Loading…
Reference in New Issue
Block a user