Use context in Server

This commit is contained in:
SALLEYRON Julien 2018-03-14 13:14:03 +01:00 committed by Traefiker Bot
parent 526a04d4c8
commit f99363674b
5 changed files with 47 additions and 36 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"context"
"encoding/json"
fmtlog "log"
"net/http"
@ -173,7 +174,8 @@ func runCmd(globalConfiguration *configuration.GlobalConfiguration, configFile s
acme.Get().SetConfigListenerChan(make(chan types.Configuration))
svr.AddListener(acme.Get().ListenConfiguration)
}
svr.Start()
ctx := cmd.ContextWithSignal(context.Background())
svr.StartWithContext(ctx)
defer svr.Close()
sent, err := daemon.SdNotify(false, "READY=1")