Bugfixes towards blogpost 4

This commit is contained in:
frikky
2020-06-23 20:04:00 +02:00
parent d4cbccd47e
commit 0d17de238b
10 changed files with 86 additions and 47 deletions
+3 -2
View File
@@ -455,13 +455,14 @@ func zombiecheck() error {
continue
}
if container.State != "running" {
// Need to check time here too because a container can be removed the same instant as its created
currenttime := time.Now().Unix()
if container.State != "running" && currenttime-container.Created > int64(workerTimeout) {
removeContainers = append(removeContainers, container.ID)
containerNames[container.ID] = name
}
// stopcontainer & removecontainer
currenttime := time.Now().Unix()
//log.Printf("Time: %d - %d", currenttime-container.Created, int64(workerTimeout))
if container.State == "running" && currenttime-container.Created > int64(workerTimeout) {
stopContainers = append(stopContainers, container.ID)