hemantvirmani commited on
Commit
09dfcbe
·
1 Parent(s): 5b1c2ec

using constants from config file for retry parameters

Browse files
Files changed (1) hide show
  1. retry_utils.py +4 -3
retry_utils.py CHANGED
@@ -4,12 +4,13 @@ import time
4
  import requests
5
  from typing import Callable, Any
6
  from functools import wraps
 
7
 
8
 
9
  def retry_with_backoff(
10
- max_retries: int = 3,
11
- initial_delay: float = 1.0,
12
- backoff_factor: float = 2.0,
13
  exceptions: tuple = (requests.RequestException,)
14
  ):
15
  """
 
4
  import requests
5
  from typing import Callable, Any
6
  from functools import wraps
7
+ import config
8
 
9
 
10
  def retry_with_backoff(
11
+ max_retries: int = config.MAX_RETRIES,
12
+ initial_delay: float = config.INITIAL_RETRY_DELAY,
13
+ backoff_factor: float = config.RETRY_BACKOFF_FACTOR,
14
  exceptions: tuple = (requests.RequestException,)
15
  ):
16
  """