fix: race condition on stopping containers

This commit is contained in:
Julian Böhne
2024-02-07 08:45:19 +01:00
parent 895f7ff440
commit a467a1c10f

View File

@@ -203,7 +203,9 @@ func (s *Core) stopDependenciesFor(ctx context.Context, cid string, cts *Contain
for _, ct := range containers {
if ct.IsRunning() {
logrus.Infof("Stopping %s...", ct.NameID())
go s.client.ContainerStop(ctx, ct.ID, container.StopOptions{})
if err := s.client.ContainerStop(ctx, ct.ID, container.StopOptions{}); err != nil {
logrus.Warnf("Error stopping %s: %v", ct.NameID(), err)
}
}
}
}