Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: utils.py

Issue 878903003: Retry npm calls since they seem a bit unreliable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build_apprtc_closure.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils.py
===================================================================
--- utils.py (revision 293821)
+++ utils.py (working copy)
@@ -11,9 +11,25 @@
import sys
import subprocess
import tarfile
+import time
import zipfile
+def RunSubprocessWithRetry(cmd):
+ """Invokes the subprocess and backs off exponentially on fail."""
+ for i in range(5):
+ try:
+ subprocess.check_call(cmd)
+ return
+ except subprocess.CalledProcessError as exception:
+ backoff = pow(2, i)
+ print 'Got %s, retrying in %d seconds...' % (exception, backoff)
+ time.sleep(backoff)
+
+ print 'Giving up.'
+ raise exception
+
+
def DownloadFilesFromGoogleStorage(path):
print 'Downloading files in %s...' % path
« no previous file with comments | « build_apprtc_closure.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698