Skip to content

Commit 5e37be3

Browse files
Add read timeouts for requests (#141)
1 parent 74d3a4d commit 5e37be3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

datareservoirio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def metric() -> logging.Logger:
5151
_END_DEFAULT = 9214646400000000000 # 2262-01-01
5252
_START_DEFAULT = -9214560000000000000 # 1678-01-01
5353

54-
_TIMEOUT_DEAULT = 120
54+
_TIMEOUT_DEAULT = (120, 120)
5555

5656
_DEFAULT_MAX_PAGE_SIZE = 30000
5757

datareservoirio/storage/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,6 @@ def _df_to_blob(df, blob_url, session=_BLOBSTORAGE_SESSION):
354354
url=blob_url,
355355
headers={"x-ms-blob-type": "BlockBlob"},
356356
data=fp,
357-
timeout=(30, None),
357+
timeout=(30, 60),
358358
).raise_for_status()
359359
return

tests/test_storage/test_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test__df_to_blob_call_args_2(
106106
url=blob_url,
107107
headers={"x-ms-blob-type": "BlockBlob"},
108108
data=ANY,
109-
timeout=(30, None),
109+
timeout=(30, 60),
110110
)
111111

112112
assert mock_requests.call_args.kwargs["data"].memory == data.as_binary_csv()
@@ -539,7 +539,7 @@ def test_put(
539539
url="http://example/blob/url",
540540
headers={"x-ms-blob-type": "BlockBlob"},
541541
data=ANY,
542-
timeout=(30, None),
542+
timeout=(30, 60),
543543
),
544544
call(
545545
method="POST",

0 commit comments

Comments
 (0)