mirror of
git://git.yoctoproject.org/yocto-autobuilder-helper.git
synced 2025-07-19 20:59:02 +02:00
janitor/ab-janitor: attempt initial clones until success
If the git clone operations don't succeed the mirror_processor thread will spin updating nothing and index builds will fail. Instead the thread will attempt the clones as many times as needed logging each failure. These are bare mirrors so look for the refs dir instead of .git. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
f9391839a5
commit
8c0742cac4
|
@ -65,8 +65,12 @@ def mirror_processor(mirrordir):
|
||||||
mirror = ourconfig["repo-defaults"][repo]["url"]
|
mirror = ourconfig["repo-defaults"][repo]["url"]
|
||||||
mirrorpath = os.path.join(mirrordir, repo)
|
mirrorpath = os.path.join(mirrordir, repo)
|
||||||
mirrorpaths.append(mirrorpath)
|
mirrorpaths.append(mirrorpath)
|
||||||
if not os.path.exists(mirrorpaths[-1] + "/.git/"):
|
while not os.path.exists(mirrorpath + "/refs"):
|
||||||
os.system("git clone --bare --mirror %s %s" % (mirror, mirrorpaths[-1]))
|
exit_code = os.system("git clone --bare --mirror %s %s" % (mirror, mirrorpath))
|
||||||
|
if exit_code == 0:
|
||||||
|
break
|
||||||
|
print("Failed to clone %s. Retrying in 30 seconds..." % mirror)
|
||||||
|
time.sleep(30)
|
||||||
while True:
|
while True:
|
||||||
for path in mirrorpaths:
|
for path in mirrorpaths:
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user