Skip to content
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

Use Session for HTTP requests #738

Closed
wants to merge 11 commits into from
Closed

Use Session for HTTP requests #738

wants to merge 11 commits into from

Commits on Aug 2, 2021

  1. Use Session for HTTP requests

    Include a default requests.Session as part of settings that is used for HTTP requests to OSM APIs, and can be overridden using the utils.config. This should improve performance by re-using the underlying TCP connection when sending multiple requests to the same host, and allows a user of osmnx to override the session to provide client/server certificates when making request to any OSM API that uses 2-way SSL verification.
    hokieg3n1us committed Aug 2, 2021
    Configuration menu
    Copy the full SHA
    db6f76f View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2021

  1. Update settings.py

    Correct formatting for imports.
    hokieg3n1us committed Aug 9, 2021
    Configuration menu
    Copy the full SHA
    aa69248 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2021

  1. Resolve merge conflict

    Update downloader.py to fix out-of-scope variable.
    hokieg3n1us committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    7584155 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a4f05fe View commit details
    Browse the repository at this point in the history
  3. Format code using black

    Re-format code using black (for line length)
    hokieg3n1us committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    e2235c8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    63559e1 View commit details
    Browse the repository at this point in the history
  5. Corrected linting issue.

    Switched to Ubuntu dev machine to properly run lint_test.sh, after introducing formatting issue through Github merge conflict interface.
    hokieg3n1us committed Aug 10, 2021
    Configuration menu
    Copy the full SHA
    afe903b View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. Update docstring and remove redundant solution to load balanced service.

    Updated docstring to better describe how to use session. Since Session creates a persistent TCP connection that is used when requests are sent to the same host/port, remove redundant fix from #699. Unable to duplicate network error from tests after
    running multiple times on Python 3.6, 3.7, 3.8, and 3.9.
    hokieg3n1us committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    fbbf5af View commit details
    Browse the repository at this point in the history
  2. Refactor to resolve server closing connection

    Diagnosing the intermittent test failures, determined that the root cause was the server closing the connection due to inactivity. Refactored the settings to expose a dictionary of attributes that can be configured for a requests.Session that is instantiated when a call is made to _osm_network_download, _osm_geometries_download, or nominatum_request. Less elegant, but should allow users to provide authentication and 2-way SSL configuration, while also improving performance during repeated calls to the overpass API.
    hokieg3n1us committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    bdf95c7 View commit details
    Browse the repository at this point in the history
  3. Check key exists in session_config

    Properly check if key exists in session_config, so a user can only provide keys as necessary for their environment.
    hokieg3n1us committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    de82017 View commit details
    Browse the repository at this point in the history
  4. cleaning up extraneous files

    moving files used for local testing of different python versions
    hokieg3n1us committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    3c35302 View commit details
    Browse the repository at this point in the history