Add cancel defer

This commit is contained in:
Christopher LaPointe
2023-05-23 21:10:16 -04:00
parent fe4ec4cf2c
commit 3466d20b80

View File

@@ -138,7 +138,8 @@ func (s *Core) Poll() {
s.mux.Lock() s.mux.Lock()
defer s.mux.Unlock() defer s.mux.Unlock()
ctx, _ := context.WithTimeout(context.Background(), 30*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
s.checkForNewContainers(ctx) s.checkForNewContainers(ctx)
s.watchForInactivity(ctx) s.watchForInactivity(ctx)