Content-Length: 281882 | pFad | http://github.com/Nasdaq/data-link-python/pull/16/commits/24e8845c514f1989fba863e7fed4b0ba7dd44e57

23 session-per-request to session-over-time by runawaycoast · Pull Request #16 · Nasdaq/data-link-python · GitHub
Skip to content

session-per-request to session-over-time #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reuse adapter
  • Loading branch information
Ren Ren committed Apr 1, 2022
commit 24e8845c514f1989fba863e7fed4b0ba7dd44e57
8 changes: 4 additions & 4 deletions nasdaqdatalink/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def request(http_verb, url, **options):
return execute_request(http_verb, abs_url, **options)

def execute_request(http_verb, url, **options):
session = get_session(url)
session = get_session()

try:
response = session.request(method=http_verb,
Expand Down Expand Up @@ -67,10 +67,10 @@ def get_retries():
return retries

session = requests.Session()
adapter = HTTPAdapter(max_retries=get_retries())
session.mount(ApiConfig.api_protocol, adapter)

def get_session(url = ApiConfig.api_protocol):
adapter = HTTPAdapter(max_retries=get_retries())
session.mount(url, adapter)
def get_session():
return session

def parse(response):
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Nasdaq/data-link-python/pull/16/commits/24e8845c514f1989fba863e7fed4b0ba7dd44e57

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy