mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
Add fix from #275 for uptime of running containers
This commit is contained in:
parent
f83e73d1ea
commit
05b17798f8
@ -209,7 +209,7 @@ func (cm *Docker) inspect(id string) (insp *api.Container, found bool, failed bo
|
||||
|
||||
func calcUptime(insp *api.Container) string {
|
||||
endTime := insp.State.FinishedAt
|
||||
if endTime.IsZero() {
|
||||
if endTime.IsZero() || insp.State.Running {
|
||||
endTime = time.Now()
|
||||
}
|
||||
uptime := endTime.Sub(insp.State.StartedAt)
|
||||
|
Loading…
Reference in New Issue
Block a user