Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/parallel/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"

# default timeout for execution requests which wait for results is 1 hour.
DEFAULT_EXECUTE_TIMEOUT_SECONDS = 3600
# default timeout for http requests is 10 minutes.
DEFAULT_TIMEOUT_SECONDS = 600
DEFAULT_TIMEOUT = httpx.Timeout(timeout=DEFAULT_TIMEOUT_SECONDS, connect=5.0)
Expand Down
4 changes: 2 additions & 2 deletions src/parallel/lib/_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import httpx

from .._types import NotGiven
from .._constants import DEFAULT_TIMEOUT_SECONDS
from .._constants import DEFAULT_EXECUTE_TIMEOUT_SECONDS
from .._exceptions import APIStatusError, APITimeoutError
from .._utils._utils import is_given

Expand All @@ -19,7 +19,7 @@ def prepare_timeout_float(timeout: Union[float, httpx.Timeout, None, NotGiven])
timeout = timeout.read

if not is_given(timeout) or timeout is None:
return DEFAULT_TIMEOUT_SECONDS
return DEFAULT_EXECUTE_TIMEOUT_SECONDS

return timeout

Expand Down