Skip to content

Commit

Permalink
don't block on removing service for tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tedim52 committed Feb 13, 2024
1 parent cea7951 commit 8a83c64
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_errors"
"github.com/kurtosis-tech/kurtosis/core/server/api_container/server/startosis_engine/startosis_validator"
"github.com/kurtosis-tech/stacktrace"
"github.com/sirupsen/logrus"
"github.com/xtgo/uuid"
"go.starlark.net/starlark"
)
Expand Down Expand Up @@ -248,9 +249,12 @@ func (builtin *RunShCapabilities) Execute(ctx context.Context, _ *builtin_argume
}
}

if err = removeService(ctx, builtin.serviceNetwork, builtin.name); err != nil {
return "", stacktrace.Propagate(err, "attempted to remove the temporary task container but failed")
}
// clean up the service in the background but don't block on it
go func() {
if err = removeService(ctx, builtin.serviceNetwork, builtin.name); err != nil {
logrus.Errorf("attempted to remove the temporary task container but failed!")
}
}()

return instructionResult, err
}
Expand Down

0 comments on commit 8a83c64

Please sign in to comment.