mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-03 06:37:14 +01:00
Log restarts
This commit is contained in:
parent
a6abec8210
commit
cf06abd691
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue