Log restarts

This commit is contained in:
Matthew Holt 2016-01-25 13:41:51 -07:00
parent a6abec8210
commit cf06abd691
2 changed files with 6 additions and 0 deletions

View file

@ -32,6 +32,8 @@ func init() {
// work if executing with `go run`, since the binary is cleaned up
// when `go run` sees the initial parent process exit.
func Restart(newCaddyfile Input) error {
log.Println("[INFO] Restarting")
if newCaddyfile == nil {
caddyfileMu.Lock()
newCaddyfile = caddyfile

View file

@ -1,8 +1,12 @@
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