aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Copeland <ben.copeland@linaro.org>2018-01-04 12:07:18 +0000
committerBen Copeland <ben.copeland@linaro.org>2018-01-04 12:07:18 +0000
commit380aa39840c66a4ee8c6e39c71f58e6b851bc517 (patch)
treed42e2e77eb1933a2b81903907a25011e728eb2c8
parentdb06819b8fed49e8fa48587806a93d98261d1880 (diff)
downloadlinaro-git-tools-master.tar.gz
Grok: Improve the grok check manifest scriptHEADmaster
Change-Id: I4db44492846b6903b382b989bd2e4d29d81b57af
-rwxr-xr-xgrok-check-manifest.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/grok-check-manifest.py b/grok-check-manifest.py
index c3794be..fec4b95 100755
--- a/grok-check-manifest.py
+++ b/grok-check-manifest.py
@@ -20,9 +20,16 @@ def local_manifest(manifile):
def remote_manifest(url):
reader = codecs.getreader("utf-8")
- remote = urllib.request.urlopen(url)
- with gzip.open(remote) as f:
- return json.load(reader(f))
+ tries = 3
+ for x in range(tries):
+ try:
+ remote = urllib.request.urlopen(url)
+ with gzip.open(remote) as f:
+ return json.load(reader(f))
+ except:
+ if x + 1 == tries:
+ raise
+ time.sleep(x+1)
def _handle_deletes(lrepos, rrepos):
@@ -67,7 +74,10 @@ def compare_manifests(local, remote):
if rem_fp != local_fp:
elapsed = time.time() - remote[repo]['modified']
- if elapsed > 120: # give up 2 minutes to sync
+ threshold = 90 # normally 90 seconds is enough
+ if 'kernel.git' in repo or 'linux.git' in repo:
+ threshold = 240 # give more time for kernel syncs
+ if elapsed > threshold:
bad.append('%s rem=%s us=%s' % (repo, rem_fp, local_fp))
return to_add, to_del, bad