diff --git a/src/parallel/_constants.py b/src/parallel/_constants.py index 9025b1f..248de45 100644 --- a/src/parallel/_constants.py +++ b/src/parallel/_constants.py @@ -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) diff --git a/src/parallel/lib/_time.py b/src/parallel/lib/_time.py index c600d70..80a2306 100644 --- a/src/parallel/lib/_time.py +++ b/src/parallel/lib/_time.py @@ -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 @@ -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