Skip to content

Commit 49b8e4b

Browse files
committed
fix: make timeout optional
1 parent 701a4c1 commit 49b8e4b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: scrapegraph-py/scrapegraph_py/async_client.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class AsyncClient:
2626
def from_env(
2727
cls,
2828
verify_ssl: bool = True,
29-
timeout: float = 120,
29+
timeout: Optional[float] = None,
3030
max_retries: int = 3,
3131
retry_delay: float = 1.0,
3232
):
3333
"""Initialize AsyncClient using API key from environment variable.
3434
3535
Args:
3636
verify_ssl: Whether to verify SSL certificates
37-
timeout: Request timeout in seconds
37+
timeout: Request timeout in seconds. None means no timeout (infinite)
3838
max_retries: Maximum number of retry attempts
3939
retry_delay: Delay between retries in seconds
4040
"""
@@ -55,7 +55,7 @@ def __init__(
5555
self,
5656
api_key: str = None,
5757
verify_ssl: bool = True,
58-
timeout: float = 120,
58+
timeout: Optional[float] = None,
5959
max_retries: int = 3,
6060
retry_delay: float = 1.0,
6161
):
@@ -64,7 +64,7 @@ def __init__(
6464
Args:
6565
api_key: API key for authentication. If None, will try to load from environment
6666
verify_ssl: Whether to verify SSL certificates
67-
timeout: Request timeout in seconds
67+
timeout: Request timeout in seconds. None means no timeout (infinite)
6868
max_retries: Maximum number of retry attempts
6969
retry_delay: Delay between retries in seconds
7070
"""
@@ -90,7 +90,7 @@ def __init__(
9090
self.retry_delay = retry_delay
9191

9292
ssl = None if verify_ssl else False
93-
self.timeout = ClientTimeout(total=timeout)
93+
self.timeout = ClientTimeout(total=timeout) if timeout is not None else None
9494

9595
self.session = ClientSession(
9696
headers=self.headers, connector=TCPConnector(ssl=ssl), timeout=self.timeout

Diff for: scrapegraph-py/scrapegraph_py/client.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ class Client:
2727
def from_env(
2828
cls,
2929
verify_ssl: bool = True,
30-
timeout: float = 120,
30+
timeout: Optional[float] = None,
3131
max_retries: int = 3,
3232
retry_delay: float = 1.0,
3333
):
3434
"""Initialize Client using API key from environment variable.
3535
3636
Args:
3737
verify_ssl: Whether to verify SSL certificates
38-
timeout: Request timeout in seconds
38+
timeout: Request timeout in seconds. None means no timeout (infinite)
3939
max_retries: Maximum number of retry attempts
4040
retry_delay: Delay between retries in seconds
4141
"""
@@ -56,7 +56,7 @@ def __init__(
5656
self,
5757
api_key: str = None,
5858
verify_ssl: bool = True,
59-
timeout: float = 120,
59+
timeout: Optional[float] = None,
6060
max_retries: int = 3,
6161
retry_delay: float = 1.0,
6262
):
@@ -65,7 +65,7 @@ def __init__(
6565
Args:
6666
api_key: API key for authentication. If None, will try to load from environment
6767
verify_ssl: Whether to verify SSL certificates
68-
timeout: Request timeout in seconds
68+
timeout: Request timeout in seconds. None means no timeout (infinite)
6969
max_retries: Maximum number of retry attempts
7070
retry_delay: Delay between retries in seconds
7171
"""

0 commit comments

Comments
 (0)