Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
change task view to determine alive and health state by contents of t…
Browse files Browse the repository at this point in the history
…he HealthCheckResult rather than its existence
  • Loading branch information
drexin committed Jan 27, 2015
1 parent 3f1eabe commit 3ec8f59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ var TaskHealthComponent = React.createClass({
<dd className="text-muted">None</dd> :
<dd>{cResult.consecutiveFailures}</dd>}
<dt>Alive</dt>
{cResult.alive == null ?
<dd>No</dd> :
<dd>Yes</dd>}
{cResult.alive ?
<dd>Yes</dd> :
<dd>No</dd>}
</dl>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/js/models/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var Task = Backbone.Model.extend({
var healthCheckResults = this.get("healthCheckResults");
if (healthCheckResults != null) {
health = healthCheckResults.every(function (hcr) {
if (hcr) {
if (hcr.firstSuccess) {
nullResult = false;
return hcr.alive;
} else { // might be null
Expand Down

1 comment on commit 3ec8f59

@sttts
Copy link
Contributor

@sttts sttts commented on 3ec8f59 Jan 27, 2015

Choose a reason for hiding this comment

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

The logic of this function is pretty complicated (not due to your change though). Something like in https://github.com/mesosphere/marathon/pull/914/files#diff-26db17356b538a343ea80486ad7ffd49R200 is much simpler IMO.

Please sign in to comment.