fix fix and fix
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Pünkösd Marcell 2021-12-13 17:49:57 +01:00
parent 30104d46d3
commit 3c83d9370f
1 changed files with 9 additions and 9 deletions

View File

@ -111,25 +111,25 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]):
continue
# Select a fitting candidate from the lower rank sites
logging.debug(f"Selecting candidate out of these sites: {','.join(lower_rank_sites)}")
logging.debug(f"Selecting candidate out of these sites: {','.join(map(lambda x: x.name, lower_rank_sites))}")
candidate = None
for lower_rank_site in lower_rank_sites:
logging.debug(f"Evaluating {lower_rank_site}")
recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site}")
logging.debug(f"Evaluating {lower_rank_site.name}")
recently_troubled = redis_client.get(f"RECENTTROUBLE:{lower_rank_site.name}")
if recently_troubled:
recently_troubled = recently_troubled.decode('utf-8')
if recently_troubled:
logging.debug(f"Site {lower_rank_site} had troubles recently, better not scheduling here...")
logging.debug(f"Site {lower_rank_site.name} had troubles recently, better not scheduling here...")
continue
if lower_rank_site in incraising_queue_at:
logging.debug(f"Site {lower_rank_site} is not a good candidate: It's currently reporting in trouble...")
if lower_rank_site.name in incraising_queue_at:
logging.debug(f"Site {lower_rank_site.name} is not a good candidate: It's currently reporting in trouble...")
continue
logging.debug(f"{lower_rank_site} seems to be an ideal candidate to move a single workload to")
candidate = lower_rank_site
logging.debug(f"{lower_rank_site.name} seems to be an ideal candidate to move a single workload to")
candidate = lower_rank_site.name
break
if not candidate:
@ -149,7 +149,7 @@ def run(redis_client: Redis, site_url_map: Dict[str, str]):
target = target.decode('utf-8')
if target == site_seeking_attention:
device_to_reschedule = key[10:]
device_to_reschedule = key[10:].decode('utf-8')
break
if not device_to_reschedule: