Skip to content

Commit

Permalink
core: instance restart (reload) event (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkon authored and mholt committed Jun 12, 2018
1 parent e54dfa4 commit 6965075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,10 @@ type EventName string
// Define names for the various events
const (
StartupEvent EventName = "startup"
ShutdownEvent EventName = "shutdown"
CertRenewEvent EventName = "certrenew"
InstanceStartupEvent EventName = "instancestartup"
ShutdownEvent = "shutdown"
CertRenewEvent = "certrenew"
InstanceStartupEvent = "instancestartup"
InstanceRestartEvent = "instancerestart"
)

// EventHook is a type which holds information about a startup hook plugin.
Expand Down
1 change: 1 addition & 0 deletions sigtrap_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func trapSignalsPosix() {
purgeEventHooks()

// Kick off the restart; our work is done
EmitEvent(InstanceRestartEvent, nil)
_, err = inst.Restart(caddyfileToUse)
if err != nil {
restoreEventHooks(oldEventHooks)
Expand Down

0 comments on commit 6965075

Please sign in to comment.