MCPcopy
hub / github.com/gofiber/fiber / OnPreShutdown

Method OnPreShutdown

hooks.go:297–301  ·  view source on GitHub ↗

OnPreShutdown is a hook to execute user functions before Shutdown.

(handler ...OnPreShutdownHandler)

Source from the content-addressed store, hash-verified

295
296// OnPreShutdown is a hook to execute user functions before Shutdown.
297func (h *Hooks) OnPreShutdown(handler ...OnPreShutdownHandler) {
298 h.app.mutex.Lock()
299 h.onPreShutdown = append(h.onPreShutdown, handler...)
300 h.app.mutex.Unlock()
301}
302
303// OnPostShutdown is a hook to execute user functions after Shutdown.
304func (h *Hooks) OnPostShutdown(handler ...OnPostShutdownHandler) {

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 3

Test_Hook_OnPreShutdownFunction · 0.64