mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
plugin/health: cleanups (#2811)
Small, trivial cleanup: got triggered because I saw a comment on how health plugins polls other plugins which isn't true. * Remove useless newHealth function * healthParse -> parse * Remove useless constants Net deletion of code. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -19,13 +19,12 @@ func init() {
|
||||
}
|
||||
|
||||
func setup(c *caddy.Controller) error {
|
||||
addr, lame, err := healthParse(c)
|
||||
addr, lame, err := parse(c)
|
||||
if err != nil {
|
||||
return plugin.Error("health", err)
|
||||
}
|
||||
|
||||
h := newHealth(addr)
|
||||
h.lameduck = lame
|
||||
h := &health{Addr: addr, stop: make(chan bool), lameduck: lame}
|
||||
|
||||
c.OnStartup(func() error {
|
||||
metrics.MustRegister(c, HealthDuration)
|
||||
@@ -40,7 +39,7 @@ func setup(c *caddy.Controller) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func healthParse(c *caddy.Controller) (string, time.Duration, error) {
|
||||
func parse(c *caddy.Controller) (string, time.Duration, error) {
|
||||
addr := ""
|
||||
dur := time.Duration(0)
|
||||
for c.Next() {
|
||||
|
||||
Reference in New Issue
Block a user