mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
remove containers from connector map on destroyed state
This commit is contained in:
parent
389dee0f3c
commit
bdea7d5853
@ -84,6 +84,13 @@ func (cm *Runc) refresh(id string) {
|
|||||||
}
|
}
|
||||||
c := cm.MustGet(id)
|
c := cm.MustGet(id)
|
||||||
|
|
||||||
|
// remove container if entered destroyed state on last refresh
|
||||||
|
// this gives adequate time for the collector to be shut down
|
||||||
|
if c.GetMeta("state") == "destroyed" {
|
||||||
|
cm.delByID(id)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
status, err := libc.Status()
|
status, err := libc.Status()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warningf("failed to read status for container: %s\n", err)
|
log.Warningf("failed to read status for container: %s\n", err)
|
||||||
@ -123,6 +130,7 @@ func (cm *Runc) refreshAll() {
|
|||||||
for id, _ := range cm.containers {
|
for id, _ := range cm.containers {
|
||||||
cm.needsRefresh <- id
|
cm.needsRefresh <- id
|
||||||
}
|
}
|
||||||
|
log.Debugf("queued %d containers for refresh", len(cm.containers))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cm *Runc) Loop() {
|
func (cm *Runc) Loop() {
|
||||||
|
Loading…
Reference in New Issue
Block a user