mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-06 04:34:37 +08:00
core: Replace admin server later in provisionContext (#7004)
This commit is contained in:
16
caddy.go
16
caddy.go
@ -505,14 +505,6 @@ func provisionContext(newCfg *Config, replaceAdminServer bool) (Context, error)
|
|||||||
return ctx, err
|
return ctx, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the admin endpoint (and stop any prior one)
|
|
||||||
if replaceAdminServer {
|
|
||||||
err = replaceLocalAdminServer(newCfg, ctx)
|
|
||||||
if err != nil {
|
|
||||||
return ctx, fmt.Errorf("starting caddy administration endpoint: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// create the new filesystem map
|
// create the new filesystem map
|
||||||
newCfg.fileSystems = &filesystems.FileSystemMap{}
|
newCfg.fileSystems = &filesystems.FileSystemMap{}
|
||||||
|
|
||||||
@ -544,6 +536,14 @@ func provisionContext(newCfg *Config, replaceAdminServer bool) (Context, error)
|
|||||||
return ctx, err
|
return ctx, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// start the admin endpoint (and stop any prior one)
|
||||||
|
if replaceAdminServer {
|
||||||
|
err = replaceLocalAdminServer(newCfg, ctx)
|
||||||
|
if err != nil {
|
||||||
|
return ctx, fmt.Errorf("starting caddy administration endpoint: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Load and Provision each app and their submodules
|
// Load and Provision each app and their submodules
|
||||||
err = func() error {
|
err = func() error {
|
||||||
for appName := range newCfg.AppsRaw {
|
for appName := range newCfg.AppsRaw {
|
||||||
|
Reference in New Issue
Block a user