Commit 0075154a authored by Charlie Getzen's avatar Charlie Getzen

Use a goroutine when interacting with kube api

Signed-off-by: 's avatarCharlie Getzen <charlie.getzen@procore.com>
parent bacb6ceb
...@@ -550,8 +550,16 @@ func perform(infos Result, fn ResourceActorFunc) error { ...@@ -550,8 +550,16 @@ func perform(infos Result, fn ResourceActorFunc) error {
return ErrNoObjectsVisited return ErrNoObjectsVisited
} }
errs := make(chan error)
for _, info := range infos { for _, info := range infos {
if err := fn(info); err != nil { go func(i *resource.Info) {
errs <- fn(i)
}(info)
}
for range infos {
err := <-errs
if err != nil {
return err return err
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment