Skip to content

Commit 3853764

Browse files
committed
Return random list of caches if unable to reach geoip services
1 parent e8454a5 commit 3853764

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

bin/stashcp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,10 @@ def get_best_stashcache():
565565
if order_str == '':
566566
# Unable to find a geo_ip server to use, return random choice from caches!
567567
minsite = random.choice(caches_list)
568+
random.shuffle(caches_list)
569+
nearest_cache_list = [cache['name'] for cache in caches_list]
568570
logging.error("Unable to use Geoip to find closest cache! Returning random cache %s", minsite)
571+
logging.debug("Ordered list of nearest caches: %s", str(nearest_cache_list))
569572
return minsite
570573
else:
571574
# The order string should be something like:

0 commit comments

Comments
 (0)