Skip to content

Commit e30ad57

Browse files
committed
fix: raise the default timeout to 300 seconds
A sync request can run for several minutes. With a 60-second timeout the client stopped slow requests and sent them again. Also correct the ConflictError docstring: a 409 is a reused idempotency key, and the concurrency limit is a 429.
1 parent d99c129 commit e30ad57

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Valid `task_type` values: `CHATGPT`, `GEMINI`, `PERPLEXITY`, `COPILOT`, `GROK`,
113113
client = Cloro(
114114
api_key="sk_live_...",
115115
base_url="https://api.cloro.dev", # override if needed
116-
timeout=60.0, # per-request seconds
116+
timeout=300.0, # per-request seconds (the default)
117117
max_retries=2, # timeouts, connection errors, 429/5xx
118118
)
119119
```

‎src/cloro/_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from .resources.monitor import MonitorResource
2727

2828
DEFAULT_BASE_URL = "https://api.cloro.dev"
29-
DEFAULT_TIMEOUT = 60.0
29+
DEFAULT_TIMEOUT = 300.0 # a sync request can run for several minutes
3030
DEFAULT_MAX_RETRIES = 2
3131

3232
_STATUS_MAP = {

‎src/cloro/_exceptions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class NotFoundError(APIStatusError):
7979

8080

8181
class ConflictError(APIStatusError):
82-
"""409 — the request conflicts with current state (e.g. concurrency limit)."""
82+
"""409 — the request conflicts with current state (e.g. a reused idempotency key)."""
8383

8484

8585
class RateLimitError(APIStatusError):

0 commit comments

Comments
 (0)