dkutils.decorators module

dkutils.decorators.retry_50X_httperror(tries=3, delay=2, backoff=2)[source]

Retry calling the decorated function using an exponential backoff.

Based on: http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry

Parameters
  • tries (int) – Number of times to try (not retry) before giving up

  • delay (int) – Initial delay between retries in seconds

  • backoff (int) – Backoff multiplier e.g. value of 2 will double the delay each retry