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