浏览代码

Record termination time in state.

Supercedes pull #1946
Paul Nasrat 11 年之前
父节点
当前提交
2eb404ab14
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      state.go

+ 2 - 0
state.go

@@ -13,6 +13,7 @@ type State struct {
 	Pid       int
 	Pid       int
 	ExitCode  int
 	ExitCode  int
 	StartedAt time.Time
 	StartedAt time.Time
+	FinishedAt time.Time
 	Ghost     bool
 	Ghost     bool
 }
 }
 
 
@@ -38,5 +39,6 @@ func (s *State) setRunning(pid int) {
 func (s *State) setStopped(exitCode int) {
 func (s *State) setStopped(exitCode int) {
 	s.Running = false
 	s.Running = false
 	s.Pid = 0
 	s.Pid = 0
+	s.FinishedAt = time.Now()
 	s.ExitCode = exitCode
 	s.ExitCode = exitCode
 }
 }