Skip to content

Commit

Permalink
increasing connection pool size and retry attempts for node norm
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Jul 23, 2024
1 parent 9f19660 commit ccd0e57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Common/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ def get_current_node_norm_version(self):

@staticmethod
def get_normalization_requests_session():
pool_maxsize = min(os.cpu_count(), 10)
s = requests.Session()
retries = Retry(total=5,
backoff_factor=.2,
retries = Retry(total=10,
backoff_factor=.5,
status_forcelist=[502, 503, 504, 403, 429])
s.mount('https://', HTTPAdapter(max_retries=retries))
s.mount('http://', HTTPAdapter(max_retries=retries))
s.mount('https://', HTTPAdapter(max_retries=retries, pool_maxsize=pool_maxsize))
s.mount('http://', HTTPAdapter(max_retries=retries, pool_maxsize=pool_maxsize))
return s


Expand Down

0 comments on commit ccd0e57

Please sign in to comment.