mirror of
https://github.com/caddyserver/caddy.git
synced 2026-11-11 19:37:55 +00:00
core: synchronize Stop with concurrent config reloads (#8038)
Signed-off-by: hendrixx-cnc <tjhendrx@icloud.com>
This commit is contained in:
1 file changed
+4
-6
@@ -692,21 +692,19 @@ type ConfigLoader interface {
|
||||
// stop the others. Stop should only be called
|
||||
// if not replacing with a new config.
|
||||
func Stop() error {
|
||||
currentCtxMu.RLock()
|
||||
ctx := currentCtx
|
||||
currentCtxMu.RUnlock()
|
||||
|
||||
rawCfgMu.Lock()
|
||||
unsyncedStop(ctx)
|
||||
defer rawCfgMu.Unlock()
|
||||
|
||||
currentCtxMu.Lock()
|
||||
ctx := currentCtx
|
||||
currentCtx = Context{}
|
||||
currentCtxMu.Unlock()
|
||||
|
||||
unsyncedStop(ctx)
|
||||
|
||||
rawCfgJSON = nil
|
||||
rawCfgIndex = nil
|
||||
rawCfg[rawConfigKey] = nil
|
||||
rawCfgMu.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user