Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit cb64f58

Browse files
committed
Require hyper >= 0.8.0.dev0, add timeout
1 parent 52eb5f3 commit cb64f58

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

orbitdbapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.2.0.rc.1.4'
1+
__version__ = '0.2.0.rc.2.0'

orbitdbapi/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ def __init__ (self, **kwargs):
1111
self.__config = kwargs
1212
self.__base_url = self.__config.get('base_url')
1313
self.__use_db_cache = self.__config.get('use_db_cache', True)
14-
14+
self.__timeout = self.__config.get('timeout', 30)
1515
self.__session = requests.Session()
16-
self.__session.mount(self.__base_url, HTTP20Adapter(timeout=self.__config.get('timeout', 30)))
16+
self.__session.mount(self.__base_url, HTTP20Adapter(timeout=self.__timeout))
1717

1818
@property
1919
def use_db_cache(self):
2020
return self.__use_db_cache
2121

2222
def _do_request(self, *args, **kwargs):
23+
kwargs['timeout'] = kwargs.get('timeout', self.__timeout)
2324
try:
2425
return self.__session.request(*args, **kwargs)
2526
except:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
url='https://github.com/phillmac/py-orbit-db-http-client',
1212
packages=find_packages(),
1313
install_requires=[
14-
'requests >= 2.11'
14+
'requests >= 2.11',
15+
'hyper >= 0.8.0.dev0'
1516
],
1617
classifiers=[
1718
'Programming Language :: Python :: 3',

0 commit comments

Comments
 (0)