MCPcopy Create free account
hub / github.com/apache/arrow / decorate

Function decorate

python/pyarrow/tests/conftest.py:179–195  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

177 The multiplier to delay after each attempt.
178 """
179 def decorate(func):
180 @functools.wraps(func)
181 def wrapper(*args, **kwargs):
182 remaining_attempts = attempts
183 curr_delay = delay
184 while remaining_attempts > 0:
185 try:
186 return func(*args, **kwargs)
187 except Exception as err:
188 remaining_attempts -= 1
189 last_exception = err
190 curr_delay *= backoff
191 if max_delay:
192 curr_delay = min(curr_delay, max_delay)
193 time.sleep(curr_delay)
194 raise last_exception
195 return wrapper
196 return decorate
197
198

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected