Skip to content

Commit

Permalink
address some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaqin1 committed Mar 4, 2024
1 parent 6faa893 commit ca10a65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions deploy-agent/deployd/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def _read_host_info(self):
except Exception:
log.warn('Host ip information does not exist.')
pass
IS_PINTEREST=True

if IS_PINTEREST and self._use_host_info is False:
# Read new keys from facter always
Expand Down
8 changes: 4 additions & 4 deletions deploy-agent/deployd/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ def redeploy_check_container(labels, service, redeploy) -> int:
return 0

def redeploy_check_non_container(commit, service, redeploy, healthcheckConfigs):
if "HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY" in healthcheckConfigs and healthcheckConfigs["HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY"] == "True":
if healthcheckConfigs.get("HEALTHCHECK_REDEPLOY_WHEN_UNHEALTHY") == "True":
log.info(f"Auto redeployment is enabled on service {service}")
if "HEALTHCHECK_REDEPLOY_MAX_RETRY" in healthcheckConfigs and redeploy < int(healthcheckConfigs["HEALTHCHECK_REDEPLOY_MAX_RETRY"]) or \
"HEALTHCHECK_REDEPLOY_MAX_RETRY" not in healthcheckConfigs and redeploy < 3:
log.info(f"current redeploy is {redeploy}")
max_retry = int(healthcheckConfigs.get("HEALTHCHECK_REDEPLOY_MAX_RETRY", REDEPLOY_MAX_RETRY))
if redeploy < max_retry:
log.info(f"redeploy is {redeploy}; max retry is {max_retry}")
send_statsboard_metric(name='deployd.service_health_status', value=1,
tags={"status": "redeploy", "service": service, "commit": commit})
return "redeploy-" + str(redeploy + 1)
Expand Down

0 comments on commit ca10a65

Please sign in to comment.