Skip to content

Commit

Permalink
changed print statements to bt.logging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
hscott-yuma committed Dec 6, 2024
1 parent ef5f00b commit 189062b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions precog/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ def func_with_retry(func: Callable, max_attempts: int = 3, delay: float = 1, *ar
return result
except Exception as e:
attempt += 1
print(f"Attempt {attempt} failed with error: {e}")
bt.logging.debug(f"Function {func} failed: Attempt {attempt} of {max_attempts} with error: {e}")
if attempt == max_attempts:
bt.logging.error(f"Function {func} failed {max_attempts} times, skipping.")
raise
else:
print(f"Retrying... (Attempt {attempt + 1}) in {delay} seconds")
time.sleep(delay)

0 comments on commit 189062b

Please sign in to comment.