Skip to content

Commit

Permalink
convert time env var to int
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhe-log10 committed Feb 21, 2024
1 parent 08d79d2 commit 6e7866b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions log10/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ def post_request(url: str, json_payload: dict = {}) -> requests.Response:
headers = {"x-log10-token": token, "Content-Type": "application/json"}
json_payload["organization_id"] = org_id
try:
# todo: set timeout
res = requests.post(
url, headers=headers, json=json_payload, timeout=os.environ.get("LOG10_REQUESTS_TIMEOUT", 10)
)
timeout = int(os.environ.get("LOG10_REQUESTS_TIMEOUT", 10))
res = requests.post(url, headers=headers, json=json_payload, timeout=timeout)
# raise_for_status() will raise an exception if the status is 4xx, 5xxx
res.raise_for_status()

Expand Down

0 comments on commit 6e7866b

Please sign in to comment.