code: def retry_with_delay(f, delay=60):
      
      @wraps(f)
      def inner(*args, **kwargs):
          kwargs['timeout'] = 5
          remaining = get_retries() + 1
          while remaining:
              remaining -= 1
              try:
                  return f(*args, **kwargs)
              except (requests.ConnectionError, requests.Timeout):
                  if not remaining:
                      raise
                  gevent.sleep(delay)
      return inner
docs: Retry the wrapped requests.request function in case of ConnectionError.
      Optionally limit the number of retries or set the delay between retries.