mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-08 11:58:49 +03:00
17 lines
358 B
Go
17 lines
358 B
Go
package caddy
|
|
|
|
import "log"
|
|
|
|
// Restart restarts Caddy forcefully using newCaddyfile,
|
|
// or, if nil, the current/existing Caddyfile is reused.
|
|
func Restart(newCaddyfile Input) error {
|
|
log.Println("[INFO] Restarting")
|
|
|
|
if newCaddyfile == nil {
|
|
caddyfileMu.Lock()
|
|
newCaddyfile = caddyfile
|
|
caddyfileMu.Unlock()
|
|
}
|
|
|
|
return restartInProc(newCaddyfile)
|
|
}
|