mirror of https://github.com/golang/go.git
fix authentication in parallel LoadAllCL
R=r http://go/go-review/1024018
This commit is contained in:
parent
696e802329
commit
e67161ee3f
|
|
@ -372,13 +372,20 @@ def LoadAllCL(ui, repo, web=True):
|
||||||
files = [f for f in os.listdir(dir) if f.startswith('cl.')]
|
files = [f for f in os.listdir(dir) if f.startswith('cl.')]
|
||||||
if not files:
|
if not files:
|
||||||
return m
|
return m
|
||||||
if web:
|
|
||||||
# Authenticate now, so we can use threads below
|
|
||||||
MySend(None)
|
|
||||||
active = []
|
active = []
|
||||||
|
first = True
|
||||||
for f in files:
|
for f in files:
|
||||||
t = LoadCLThread(ui, repo, dir, f, web)
|
t = LoadCLThread(ui, repo, dir, f, web)
|
||||||
t.start()
|
t.start()
|
||||||
|
if web and first:
|
||||||
|
# first request: wait in case it needs to authenticate
|
||||||
|
# otherwise we get lots of user/password prompts
|
||||||
|
# running in parallel.
|
||||||
|
t.join()
|
||||||
|
if t.cl:
|
||||||
|
m[t.cl.name] = t.cl
|
||||||
|
first = False
|
||||||
|
else:
|
||||||
active.append(t)
|
active.append(t)
|
||||||
for t in active:
|
for t in active:
|
||||||
t.join()
|
t.join()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue