From 2a477f49a2d35e4bf67441460849691c7ce43825 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 5 Dec 2021 13:40:53 +0100 Subject: [PATCH] feat: remove old containers --- store.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/store.go b/store.go index 8c26692..eddec72 100644 --- a/store.go +++ b/store.go @@ -21,6 +21,10 @@ func storeContainers(c *client.Client, containers []types.Container) { lock.Lock() defer lock.Unlock() + for _, container := range containers { + delete(store, container.ID) + } + for _, container := range containers { if container.State != "running" { continue @@ -40,7 +44,4 @@ func storeContainers(c *client.Client, containers []types.Container) { store[container.ID] = dumper } - - // TODO: remove old containers - }