Skip to content

Commit 08d79d2

Browse files
authored
set load requests post timeout (#107)
* set load requests post timeout, default to 10, or set LOG10_REQUESTS_TIMEOUT * bump version to 0.6.3
1 parent 48b6324 commit 08d79d2

File tree

4 files changed

+105
-103
lines changed

4 files changed

+105
-103
lines changed

log10/load.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ def post_request(url: str, json_payload: dict = {}) -> requests.Response:
7575
json_payload["organization_id"] = org_id
7676
try:
7777
# todo: set timeout
78-
res = requests.post(url, headers=headers, json=json_payload)
78+
res = requests.post(
79+
url, headers=headers, json=json_payload, timeout=os.environ.get("LOG10_REQUESTS_TIMEOUT", 10)
80+
)
7981
# raise_for_status() will raise an exception if the status is 4xx, 5xxx
8082
res.raise_for_status()
8183

0 commit comments

Comments
 (0)