29
29
from azul .chalice import (
30
30
ServiceUnavailableError ,
31
31
)
32
+ from azul .collections import (
33
+ adict ,
34
+ )
32
35
from azul .http import (
33
36
LimitedTimeoutException ,
34
37
TooManyRequestsException ,
@@ -249,17 +252,6 @@ def download_file(self,
249
252
raise TooManyRequestsError (* e .args )
250
253
if download .retry_after is not None :
251
254
retry_after = min (download .retry_after , int (1.3 ** request_index ))
252
- query_params = {
253
- 'version' : download .file_version ,
254
- 'fileName' : download .file_name ,
255
- 'requestIndex' : request_index + 1
256
- }
257
- if download .drs_uri is not None :
258
- query_params ['drsUri' ] = download .drs_uri
259
- if download .token is not None :
260
- query_params ['token' ] = download .token
261
- if download .replica is not None :
262
- query_params ['replica' ] = download .replica
263
255
if wait is not None :
264
256
if wait == '0' :
265
257
pass
@@ -274,7 +266,15 @@ def download_file(self,
274
266
retry_after = round (retry_after - server_side_sleep )
275
267
else :
276
268
assert False , wait
277
- query_params ['wait' ] = wait
269
+ query_params = adict (
270
+ version = download .file_version ,
271
+ fileName = download .file_name ,
272
+ drsUri = download .drs_uri ,
273
+ token = download .token ,
274
+ replica = download .replica ,
275
+ requestIndex = request_index + 1 ,
276
+ wait = wait
277
+ )
278
278
return {
279
279
'Status' : 301 ,
280
280
** ({'Retry-After' : retry_after } if retry_after else {}),
0 commit comments