Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Commit

Permalink
Retain state detail other than actual status when receiving a 0 pid.
Browse files Browse the repository at this point in the history
  • Loading branch information
theothertomelliott committed Apr 29, 2018
1 parent 7d1dd7d commit c716fa1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions edward/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,13 @@ func (c *Client) getStates(service *services.ServiceConfig) ([]statusCommandTupl

statuses, _ := instance.LoadStatusForService(service, c.DirConfig.StateDir)
if status, ok := statuses[command.InstanceId]; ok {
if command.Pid != 0 {
return []statusCommandTuple{
statusCommandTuple{
status: status,
command: command,
},
}, nil
}
// If the PID has been set to zero, the runner has died
if command.Pid == 0 {
status.State = instance.StateDied
}
return []statusCommandTuple{
statusCommandTuple{
status: instance.Status{
State: instance.StateDied,
},
status: status,
command: command,
},
}, nil
Expand Down

0 comments on commit c716fa1

Please sign in to comment.