MCPcopy Index your code
hub / github.com/devspace-sh/devspace / RunAlways

Method RunAlways

pkg/util/interrupt/interrupt.go:118–126  ·  view source on GitHub ↗

RunAlways ensures that the function fn is run and runs the notify function if interrupted meanwhile or the function has ended

(fn func() error, notify func())

Source from the content-addressed store, hash-verified

116
117// RunAlways ensures that the function fn is run and runs the notify function if interrupted meanwhile or the function has ended
118func (h *Handler) RunAlways(fn func() error, notify func()) error {
119 defer notify()
120
121 id := uuid.New().String()
122 h.register(id, notify)
123 defer h.unregister(id)
124
125 return fn()
126}
127
128// Start ensures the handler is started and ready for incoming signals
129func (h *Handler) Start() {

Callers

nothing calls this directly

Calls 4

registerMethod · 0.95
unregisterMethod · 0.95
notifyStruct · 0.85
StringMethod · 0.45

Tested by

no test coverage detected