mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
Configurable zone reload interval in file plugin (#2110)
* Configurable zone reload interval in file plugin * passing reload config from auto plugin to file plugin. removed noReload property from Zone struct. fixed tests based on short file reload hack
This commit is contained in:
@@ -144,8 +144,15 @@ func autoParse(c *caddy.Controller) (Auto, error) {
|
||||
a.loader.duration = time.Duration(i) * time.Second
|
||||
}
|
||||
|
||||
case "reload":
|
||||
d, err := time.ParseDuration(c.RemainingArgs()[0])
|
||||
if err != nil {
|
||||
return a, plugin.Error("file", err)
|
||||
}
|
||||
a.loader.ReloadInterval = d
|
||||
|
||||
case "no_reload":
|
||||
a.loader.noReload = true
|
||||
a.loader.ReloadInterval = 0
|
||||
|
||||
case "upstream":
|
||||
args := c.RemainingArgs()
|
||||
|
||||
Reference in New Issue
Block a user