Skip to content

Commit

Permalink
Merge pull request #913 from HubSpot/failed_task_healthcheck_message
Browse files Browse the repository at this point in the history
Healthcheck notification won't display if task state is TASK_FAILED
  • Loading branch information
ssalinas committed Mar 10, 2016
2 parents af8f571 + c16a4f7 commit ba2709b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SingularityUI/app/models/TaskHistory.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TaskHistory extends Model

parse: (taskHistory) ->
taskHistory.taskUpdates = _.sortBy taskHistory.taskUpdates, (t) -> t.timestamp
taskHistory.lastKnownState = _.last(taskHistory.taskUpdates).taskState
taskHistory.healthcheckResults = (_.sortBy taskHistory.healthcheckResults, (t) -> t.timestamp).reverse()

taskHistory.task?.mesosTask?.executor?.command?.environment?.variables = _.sortBy taskHistory.task.mesosTask.executor.command.environment.variables, "name"
Expand Down Expand Up @@ -52,7 +53,7 @@ class TaskHistory extends Model
taskHistory.slaveMissing = true


taskHistory.isCleaning = _.last( taskHistory.taskUpdates ).taskState is 'TASK_CLEANING'
taskHistory.isCleaning = taskHistory.lastKnownState is 'TASK_CLEANING'

taskHistory.requestId = taskHistory.task.taskId.requestId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Task = require '../models/Task'

class taskHealthcheckNotificationSubview extends View

noHealthcheckMessageStates: [
'TASK_FAILED',
'TASK_FINISHED',
'TASK_LOST'
]

events: ->
_.extend super,
'click [data-action="viewHealthchecks"]': 'triggerToggleHealthchecks'
Expand All @@ -14,6 +20,7 @@ class taskHealthcheckNotificationSubview extends View

render: =>
return if not @model.synced
return if @model.attributes.lastKnownState in @noHealthcheckMessageStates
@$el.html @template @renderData()

renderData: =>
Expand Down

0 comments on commit ba2709b

Please sign in to comment.