Skip to content

Commit bab9613

Browse files
committed
Use 4 hosts as backup
1 parent f6bcdcc commit bab9613

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

stashcp/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def download_xrootd(sourceFile, destination, debug, payload):
324324
num_available_caches = len(nearest_cache_list)
325325
tries = 0
326326
xrd_exit = ""
327-
for cache_idx in range(min(3, num_available_caches)): # try 3 caches, or how ever many caches are in the list
327+
for cache_idx in range(min(4, num_available_caches)): # try 4 caches, or how ever many caches are in the list
328328
tries = cache_idx+1
329329
cache = nearest_cache_list[cache_idx]
330330
logging.debug("Using Cache %s", cache)
@@ -400,13 +400,12 @@ def download_http(source, destination, debug, payload):
400400
download_output = "-O"
401401
final_destination = os.path.join(dest_dir, os.path.basename(source))
402402

403-
# Try 2 nearest caches
404403
success = False
405404
start = end = 0
406405
tried_cache = ""
407406
tries = 0
408-
# Try the 3 nearest caches
409-
for cache in nearest_cache_list[:min(3, len(nearest_cache_list)]:
407+
# Try the 4 nearest caches
408+
for cache in nearest_cache_list[:min(4, len(nearest_cache_list))]:
410409
tries = tries + 1
411410
tried_cache = cache
412411
# Parse the nearest_cache url, make sure it uses http

0 commit comments

Comments
 (0)