File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,9 @@ def cache_and_return_session(
86
86
f"{ evicted_session } " ,
87
87
)
88
88
threading .Timer (
89
- request_timeout or 0 + 0.1 ,
89
+ # If `request_timeout` is `None`, don't wait forever for the closing
90
+ # session to finish the request. Instead, wait over the default timeout.
91
+ request_timeout or DEFAULT_HTTP_TIMEOUT + 0.1 ,
90
92
self ._close_evicted_sessions ,
91
93
args = [evicted_sessions ],
92
94
).start ()
@@ -214,7 +216,10 @@ async def async_cache_and_return_session(
214
216
# is closed.
215
217
asyncio .create_task (
216
218
self ._async_close_evicted_sessions (
217
- request_timeout .total or 0 + 0.1 ,
219
+ # if `ClientTimeout.total` is `None`, don't wait forever for the
220
+ # closing session to finish the request. Instead, use the default
221
+ # timeout.
222
+ request_timeout .total or DEFAULT_HTTP_TIMEOUT + 0.1 ,
218
223
evicted_sessions ,
219
224
)
220
225
)
You can’t perform that action at this time.
0 commit comments