MCPcopy
hub / github.com/caddyserver/caddy / Stop

Function Stop

caddy.go:694–712  ·  view source on GitHub ↗

Stop stops running the current configuration. It is the antithesis of Run(). This function will log any errors that occur during the stopping of individual apps and continue to stop the others. Stop should only be called if not replacing with a new config.

()

Source from the content-addressed store, hash-verified

692// stop the others. Stop should only be called
693// if not replacing with a new config.
694func Stop() error {
695 currentCtxMu.RLock()
696 ctx := currentCtx
697 currentCtxMu.RUnlock()
698
699 rawCfgMu.Lock()
700 unsyncedStop(ctx)
701
702 currentCtxMu.Lock()
703 currentCtx = Context{}
704 currentCtxMu.Unlock()
705
706 rawCfgJSON = nil
707 rawCfgIndex = nil
708 rawCfg[rawConfigKey] = nil
709 rawCfgMu.Unlock()
710
711 return nil
712}
713
714// unsyncedStop stops ctx from running, but has
715// no locking around ctx. It is a no-op if ctx has a

Callers 1

exitProcessFunction · 0.85

Calls 1

unsyncedStopFunction · 0.85

Tested by

no test coverage detected