9
9
import aiohttp .client
10
10
import aiohttp .web
11
11
import certifi
12
+ from aiohttp import ClientTimeout
12
13
13
14
import swift_browser_ui .common .vault_client
14
15
from swift_browser_ui .upload import common
@@ -103,7 +104,7 @@ async def a_sync_object_segments(self, manifest: str) -> str:
103
104
"X-Auth-Token" : self .token ,
104
105
"Accept-Encoding" : "identity" ,
105
106
},
106
- timeout = REPL_TIMEOUT ,
107
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
107
108
ssl = ssl_context ,
108
109
) as resp :
109
110
if resp .status == 404 :
@@ -136,7 +137,7 @@ def filter_with_prefix(segment: str) -> bool:
136
137
"X-Auth-Token" : self .token ,
137
138
"Accept-Encoding" : "identity" ,
138
139
},
139
- timeout = REPL_TIMEOUT ,
140
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
140
141
ssl = ssl_context ,
141
142
) as resp_g :
142
143
length = int (resp_g .headers ["Content-Length" ])
@@ -163,7 +164,7 @@ def filter_with_prefix(segment: str) -> bool:
163
164
to_url ,
164
165
data = resp_g .content .iter_chunked (65564 ),
165
166
headers = headers ,
166
- timeout = REPL_TIMEOUT ,
167
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
167
168
ssl = ssl_context ,
168
169
) as resp_p :
169
170
LOGGER .debug (f"Segment { segment } status { resp_p .status } " )
@@ -189,7 +190,7 @@ async def a_copy_object(self, object_name: str) -> None:
189
190
"X-Auth-Token" : self .token ,
190
191
"Accept-Encoding" : "identity" ,
191
192
},
192
- timeout = REPL_TIMEOUT ,
193
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
193
194
ssl = ssl_context ,
194
195
) as resp_g :
195
196
# If the source object doesn't exist, abort
@@ -223,7 +224,7 @@ async def a_copy_object(self, object_name: str) -> None:
223
224
common .generate_download_url (self .host , self .container , object_name ),
224
225
data = resp_g .content .iter_chunked (65564 ),
225
226
headers = headers ,
226
- timeout = REPL_TIMEOUT ,
227
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
227
228
ssl = ssl_context ,
228
229
) as resp_p :
229
230
if resp_p .status == 408 :
@@ -252,7 +253,7 @@ async def a_copy_object(self, object_name: str) -> None:
252
253
),
253
254
data = b"" ,
254
255
headers = headers ,
255
- timeout = REPL_TIMEOUT ,
256
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
256
257
ssl = ssl_context ,
257
258
) as resp :
258
259
if resp .status != 201 :
@@ -307,7 +308,7 @@ async def a_get_container_page(self, marker: str = "") -> list[str]:
307
308
),
308
309
headers = {"X-Auth-Token" : self .token },
309
310
params = {"marker" : marker } if marker else None ,
310
- timeout = REPL_TIMEOUT ,
311
+ timeout = ClientTimeout ( total = REPL_TIMEOUT ) ,
311
312
ssl = ssl_context ,
312
313
) as resp :
313
314
if resp .status >= 400 :
0 commit comments