Skip to content

Commit

Permalink
fix by codereview
Browse files Browse the repository at this point in the history
  • Loading branch information
prog-supdex committed Mar 13, 2024
1 parent 1392b7c commit 982e828
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions start/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const SIGINFO syscall.Signal = 29
type process struct {
output *multiOutput

pid int
pid int
paneID string

stopSignal syscall.Signal
canDie bool
Expand All @@ -26,7 +27,6 @@ type process struct {
dead bool
interrupted bool
restart bool
paneID string

tmux *tmuxClient

Expand Down Expand Up @@ -176,8 +176,7 @@ func (p *process) observe() {
if !p.Running() {
if !p.keepingAlive {
p.out.Close()

p.reportExitCode()
p.output.WriteBoldLinef(p, "Exited with code %d", p.tmux.PaneExitCode(p.paneID))
p.keepingAlive = true
}

Expand Down Expand Up @@ -211,10 +210,3 @@ func (p *process) respawn() {
p.waitPid()
p.output.WriteBoldLinef(p, "Restarted with pid %v...", p.pid)
}

func (p *process) reportExitCode() {
exitCode := p.tmux.PaneExitCode(p.paneID)
message := fmt.Sprintf("Exited with code %d", exitCode)

p.output.WriteBoldLine(p, []byte(message))
}

0 comments on commit 982e828

Please sign in to comment.