MCPcopy Create free account
hub / github.com/flant/shell-operator / Shutdown

Method Shutdown

pkg/shell-operator/operator.go:253–258  ·  view source on GitHub ↗

Shutdown gracefully tears down everything started by Start. It is synchronous: when Shutdown returns, no goroutine spawned by the operator is still running and every TCP port / unix socket / file descriptor opened during Start has been released. Subsequent calls return the original shutdown error.

(ctx context.Context)

Source from the content-addressed store, hash-verified

251// informers and HTTP servers; if it has no deadline DefaultShutdownTimeout
252// is applied automatically.
253func (op *ShellOperator) Shutdown(ctx context.Context) error {
254 op.shutdownOnce.Do(func() {
255 op.shutdownErr = op.doShutdown(ctx)
256 })
257 return op.shutdownErr
258}
259
260func (op *ShellOperator) doShutdown(ctx context.Context) error {
261 if _, ok := ctx.Deadline(); !ok {

Callers 1

RunMethod · 0.95

Calls 1

doShutdownMethod · 0.95

Tested by

no test coverage detected