File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 50
50
MAX_RETRIES = 5
51
51
MAX_RETRY_BACKOFF = 64 # seconds
52
52
53
- # For how these settings were determined, see
54
- # https://github.com/planetlabs/planet-client-python/issues/580
55
- READ_TIMEOUT = 30.0
53
+ DEFAULT_READ_TIMEOUT_SECS = 125.0
56
54
RATE_LIMIT = 10 # per second
57
55
MAX_ACTIVE = 50
58
56
@@ -231,7 +229,11 @@ class Session(BaseSession):
231
229
```
232
230
"""
233
231
234
- def __init__ (self , auth : Optional [AuthType ] = None ):
232
+ def __init__ (
233
+ self ,
234
+ auth : Optional [AuthType ] = None ,
235
+ read_timeout_secs : Optional [float ] = None ,
236
+ ):
235
237
"""Initialize a Session.
236
238
237
239
Parameters:
@@ -246,8 +248,12 @@ def __init__(self, auth: Optional[AuthType] = None):
246
248
except exceptions .PlanetError :
247
249
auth = Auth .from_file ()
248
250
249
- LOGGER .info (f'Session read timeout set to { READ_TIMEOUT } .' )
250
- timeout = httpx .Timeout (10.0 , read = READ_TIMEOUT )
251
+ if read_timeout_secs is None :
252
+ read_timeout_secs = DEFAULT_READ_TIMEOUT_SECS
253
+
254
+ LOGGER .info (
255
+ f'Session read timeout set to { read_timeout_secs } seconds.' )
256
+ timeout = httpx .Timeout (10.0 , read = read_timeout_secs )
251
257
252
258
headers = {
253
259
'User-Agent' : self ._get_user_agent (), 'X-Planet-App' : 'python-sdk'
You can’t perform that action at this time.
0 commit comments