summaryrefslogtreecommitdiff
path: root/caddy.go
diff options
context:
space:
mode:
Diffstat (limited to 'caddy.go')
-rw-r--r--caddy.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/caddy.go b/caddy.go
index 46d8531..96dfea5 100644
--- a/caddy.go
+++ b/caddy.go
@@ -32,6 +32,7 @@ import (
"sync"
"time"
+ "github.com/caddyserver/caddy/v2/notify"
"github.com/caddyserver/certmagic"
"github.com/google/uuid"
"go.uber.org/zap"
@@ -100,6 +101,16 @@ func Run(cfg *Config) error {
// if it is different from the current config or
// forceReload is true.
func Load(cfgJSON []byte, forceReload bool) error {
+ if err := notify.NotifyReloading(); err != nil {
+ Log().Error("unable to notify reloading to service manager", zap.Error(err))
+ }
+
+ defer func() {
+ if err := notify.NotifyReadiness(); err != nil {
+ Log().Error("unable to notify readiness to service manager", zap.Error(err))
+ }
+ }()
+
return changeConfig(http.MethodPost, "/"+rawConfigKey, cfgJSON, forceReload)
}