Skip to content

select the correct healthcheck for alert#1266

Merged
ssalinas merged 1 commit into
masterfrom
healthcheck_fail_fix
Sep 2, 2016
Merged

select the correct healthcheck for alert#1266
ssalinas merged 1 commit into
masterfrom
healthcheck_fail_fix

Conversation

@ssalinas

@ssalinas ssalinas commented Sep 2, 2016

Copy link
Copy Markdown
Contributor

Use the last healthcheck in the list, not the first

/cc @tpetr

const { healthcheckResults } = task;
task.hasSuccessfulHealthcheck = healthcheckResults && healthcheckResults.length > 0 && !!_.find(healthcheckResults, (healthcheckResult) => healthcheckResult.statusCode === 200);
task.lastHealthcheckFailed = healthcheckResults && healthcheckResults.length > 0 && healthcheckResults[0].statusCode !== 200;
task.lastHealthcheckFailed = healthcheckResults && healthcheckResults.length > 0 && _.last(healthcheckResults).statusCode !== 200;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know if this was something that was always broken, or did the sorting change at some point?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it got messed up in the translation to react. It used to work. You can see we're actually using last already in the TaskAlert to display it, just not here when determining if it failed

@ssalinas
ssalinas merged commit 8604212 into master Sep 2, 2016
@ssalinas
ssalinas deleted the healthcheck_fail_fix branch September 2, 2016 20:36
@ssalinas ssalinas modified the milestone: 0.11.0 Sep 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants