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

Add timeout parameter for connect_args #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
4 changes: 2 additions & 2 deletions connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ class Connection(Database):
"""
These objects are small stateless factories for cursors, which do all the real work.
"""
def __init__(self, db_name, db_url='http://localhost:8123/', username=None, password=None, readonly=False, ssl="False"):
def __init__(self, db_name, db_url='http://localhost:8123/', username=None, password=None, readonly=False, ssl="False", timeout=60):
if ssl.upper() == "TRUE":
db_url = db_url.replace("http", "https")
elif ssl.upper() == "FALSE":
pass
else:
raise ValueError("Not Supported value of ssl parameter, only True/False values are accepted")
super(Connection, self).__init__(db_name, db_url, username, password, readonly)
super(Connection, self).__init__(db_name, db_url, username, password, readonly, timeout=timeout)
self.db_name = db_name
self.db_url = db_url
self.username = username
Expand Down