Skip to content

Commit

Permalink
HTTP driver timeout bugfix (#34)
Browse files Browse the repository at this point in the history
HTTP driver did not pull the correct integer value for connection timeout. Fixed.
  • Loading branch information
candyflipline authored Sep 3, 2024
1 parent 315727d commit ea9644b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
.ipynb_checkpoints
.tags
.vscode
.venv

## Compiled source
*.com
Expand Down
5 changes: 2 additions & 3 deletions singlestoredb/http/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ def _post(self, path: str, *args: Any, **kwargs: Any) -> requests.Response:
"""
if self._connection is None:
raise ProgrammingError(errno=2048, msg='Connection is closed.')
if 'timeout' not in kwargs:
kwargs['timeout'] = self._connection.connection_params['connect_timeout']
return self._connection._post(path, *args, **kwargs)

def callproc(
Expand Down Expand Up @@ -1126,9 +1128,6 @@ def _post(self, path: str, *args: Any, **kwargs: Any) -> requests.Response:

self._sync_connection(kwargs)

if 'timeout' not in kwargs:
kwargs['timeout'] = get_option('connect_timeout')

return self._sess.post(urljoin(self._url, path), *args, **kwargs)

def close(self) -> None:
Expand Down

0 comments on commit ea9644b

Please sign in to comment.