Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
semio committed Apr 2, 2020
1 parent f33916a commit 507d26f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ddf_utils/factory/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

# from https://www.peterbe.com/plog/best-practice-with-retries-with-requests
def requests_retry_session(
retries=5,
backoff_factor=0.3,
status_forcelist=(500, 502, 504),
session=None,
retries=5,
backoff_factor=0.3,
status_forcelist=(500, 502, 504),
session=None,
):
session = session or req.Session()
retry = Retry(
max_retry = Retry(
total=retries,
read=retries,
connect=retries,
backoff_factor=backoff_factor,
status_forcelist=status_forcelist,
)
adapter = HTTPAdapter(max_retries=retry)
adapter = HTTPAdapter(max_retries=max_retry)
session.mount('http://', adapter)
session.mount('https://', adapter)
return session
Expand Down Expand Up @@ -139,7 +139,7 @@ def run(request, session_, out_file_, resume_, file_size):
request = basereq.prepare()

if not session:
session = req.Session()
session = req.Session()

file_size = get_file_size(request, session)
run(request, session, out_file, resume, file_size)
Expand Down

0 comments on commit 507d26f

Please sign in to comment.