mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
Fix reloading in health and ready (#3473)
Signed-off-by: zouyee <zounengren@cmss.chinamobile.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
clog "github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/plugin/pkg/reuseport"
|
||||
)
|
||||
|
||||
var log = clog.NewWithPlugin("health")
|
||||
@@ -29,8 +30,7 @@ func (h *health) OnStartup() error {
|
||||
h.Addr = ":8080"
|
||||
}
|
||||
h.stop = make(chan bool)
|
||||
|
||||
ln, err := net.Listen("tcp", h.Addr)
|
||||
ln, err := reuseport.Listen("tcp", h.Addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
clog "github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/plugin/pkg/uniq"
|
||||
"github.com/coredns/coredns/plugin/pkg/reuseport"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -30,7 +31,7 @@ type ready struct {
|
||||
}
|
||||
|
||||
func (rd *ready) onStartup() error {
|
||||
ln, err := net.Listen("tcp", rd.Addr)
|
||||
ln, err := reuseport.Listen("tcp", rd.Addr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user