Skip to content

Commit 2c9a043

Browse files
authored
Make request timeout configurable. (#627)
1 parent 7ccaf39 commit 2c9a043

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ AQUARIUS_URL=https://aquarius.marketplace.dev-ocean.com
66
PARITY_ADDRESS1=0x00bd138abd70e2f00903268f3db08f2d25677c9e
77
PARITY_PASSWORD1=node0
88
PARITY_KEYFILE1=tests/resources/consumer_key_file.json
9+
REQUEST_TIMEOUT=10

ocean_provider/file_types/definitions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
logger = logging.getLogger(__name__)
1717

18-
REQUEST_TIMEOUT = 3
1918
CHUNK_SIZE = 8192
2019

2120

@@ -154,7 +153,7 @@ def _get_func_and_args(self):
154153
"url": url,
155154
"stream": True,
156155
"headers": self.headers,
157-
"timeout": REQUEST_TIMEOUT,
156+
"timeout": int(os.getenv("REQUEST_TIMEOUT", 10)),
158157
}
159158

160159
if self.userdata:

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ env =
1818
D:NETWORK_URL={{"8996": "http://127.0.0.1:8545"}}
1919
D:AQUARIUS_URL =http://172.15.0.5:5000
2020
D:STORAGE_PATH=ocean-provider.db
21+
D:REQUEST_TIMEOUT=10

0 commit comments

Comments
 (0)