Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Allow setting maxsize for PoolManager #18

Merged
merged 2 commits into from
Jul 9, 2017
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

class ConfigurationObject(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
Configuration options for RESTClientObject
"""

def __init__(self):
Expand Down Expand Up @@ -85,6 +83,12 @@ def __init__(self):
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None

# urllib3 connection pool's maximum number of connections saved
# per pool. Increasing this is useful for cases when you are
# making a lot of possibly parallel requests to the same host,
# which is often the case here.
self.connection_pool_maxsize = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change default value to 1. I don't know what default value is, but it is safer to set this to None and add an if statement in the other file to set it if not none.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per http://urllib3.readthedocs.io/en/latest/advanced-usage.html the default value is 1 but I agree we should use None and pass through. Shall amend.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


@property
def logger_file(self):
"""
Expand Down
1 change: 1 addition & 0 deletions rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, pools_size=4, config=configuration):
'ca_certs': ca_certs,
'cert_file': cert_file,
'key_file': key_file,
'maxsize': config.connection_pool_maxsize,
}

if config.assert_hostname is not None:
Expand Down