aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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