- DNS: configuration settings were not applied until full restart
This commit is contained in:
parent
00fabb0ecf
commit
d65cdd4544
|
@ -352,23 +352,6 @@ func (s *Server) IsRunning() bool {
|
||||||
return s.isRunning
|
return s.isRunning
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restart - restart server
|
|
||||||
func (s *Server) Restart() error {
|
|
||||||
s.Lock()
|
|
||||||
defer s.Unlock()
|
|
||||||
log.Print("Start reconfiguring the server")
|
|
||||||
err := s.stopInternal()
|
|
||||||
if err != nil {
|
|
||||||
return errorx.Decorate(err, "could not reconfigure the server")
|
|
||||||
}
|
|
||||||
err = s.startInternal()
|
|
||||||
if err != nil {
|
|
||||||
return errorx.Decorate(err, "could not reconfigure the server")
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reconfigure applies the new configuration to the DNS server
|
// Reconfigure applies the new configuration to the DNS server
|
||||||
func (s *Server) Reconfigure(config *ServerConfig) error {
|
func (s *Server) Reconfigure(config *ServerConfig) error {
|
||||||
s.Lock()
|
s.Lock()
|
||||||
|
|
|
@ -121,7 +121,7 @@ func (s *Server) handleSetConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
s.conf.ConfigModified()
|
s.conf.ConfigModified()
|
||||||
|
|
||||||
if restart {
|
if restart {
|
||||||
err = s.Restart()
|
err = s.Reconfigure(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(r, w, http.StatusInternalServerError, "%s", err)
|
httpError(r, w, http.StatusInternalServerError, "%s", err)
|
||||||
return
|
return
|
||||||
|
@ -172,7 +172,7 @@ func (s *Server) handleSetUpstreamConfig(w http.ResponseWriter, r *http.Request)
|
||||||
s.Unlock()
|
s.Unlock()
|
||||||
s.conf.ConfigModified()
|
s.conf.ConfigModified()
|
||||||
|
|
||||||
err = s.Restart()
|
err = s.Reconfigure(nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(r, w, http.StatusInternalServerError, "%s", err)
|
httpError(r, w, http.StatusInternalServerError, "%s", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue