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

Unified Diff: tools/telemetry/third_party/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py

Issue 1260493004: Revert "Add gsutil 4.13 to telemetry/third_party" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: tools/telemetry/third_party/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py
diff --git a/tools/telemetry/third_party/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py b/tools/telemetry/third_party/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py
deleted file mode 100644
index 466396a3b9199c1b49089bf833f0088dfbabbf3b..0000000000000000000000000000000000000000
--- a/tools/telemetry/third_party/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-
-from __future__ import print_function
-
-import traceback
-import logging
-import time
-import random
-import sys
-
-def retry(ExceptionToCheck, tries=10, timeout_secs=1.0, logger=None):
- """
- Retry calling the decorated function using an exponential backoff.
- """
- def deco_retry(f):
- def f_retry(*args, **kwargs):
- mtries, mdelay = tries, timeout_secs
- while mtries > 1:
- try:
- return f(*args, **kwargs)
- except ExceptionToCheck as e:
- #traceback.print_exc()
- half_interval = mdelay * 0.10 #interval size
- actual_delay = random.uniform(mdelay - half_interval, mdelay + half_interval)
- msg = "Retrying in %.2f seconds ..." % actual_delay
- if logger is None:
- logging.exception(msg)
- else:
- logger.exception(msg)
- time.sleep(actual_delay)
- mtries -= 1
- mdelay *= 2
- return f(*args, **kwargs)
- return f_retry # true decorator
- return deco_retry
-
-

Powered by Google App Engine
This is Rietveld 408576698