Skip to content

Commit

Permalink
Add warning log for failed tries.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 630604504
  • Loading branch information
dustinvtran authored and edward-bot committed May 4, 2024
1 parent 8f69eb2 commit c01069a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions edward2/maps.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ def robust_map(
fn_with_backoff = tenacity.retry(
retry=retry,
wait=tenacity.wait_random_exponential(min=1, max=30),
before_sleep=tenacity.before_sleep_log(
logging.get_absl_logger(), logging.WARNING
),
)(fn)
else:
fn_with_backoff = tenacity.retry(
retry=retry,
wait=tenacity.wait_random_exponential(min=1, max=30),
stop=tenacity.stop_after_attempt(max_retries + 1),
before_sleep=tenacity.before_sleep_log(
logging.get_absl_logger(), logging.WARNING
),
)(fn)
if index_to_output is None:
index_to_output = {}
Expand Down

0 comments on commit c01069a

Please sign in to comment.