mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
plugin/file: make non-existent file non-fatal (#2955)
* plugin/file: make non-existent file non-fatal If the zone file being loaded doesn't exist *and* reload is enabled, just wait the file to pop up in the normal Reload routine. If reload is set to 0s; we keep this a fatal error on startup. Aslo fix the ticker in z.Reload(): remove the per second ticks and just use the reload interval for the ticker. Brush up the documentation a bit as well. Fixes: #2951 Signed-off-by: Miek Gieben <miek@miek.nl> * Stickler and test compile Signed-off-by: Miek Gieben <miek@miek.nl> * Remove there too Signed-off-by: Miek Gieben <miek@miek.nl> * Cant README test these because zone files dont exist Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -30,7 +30,6 @@ type Zone struct {
|
||||
Expired *bool
|
||||
|
||||
ReloadInterval time.Duration
|
||||
LastReloaded time.Time
|
||||
reloadMu sync.RWMutex
|
||||
reloadShutdown chan bool
|
||||
Upstream *upstream.Upstream // Upstream for looking up external names during the resolution process.
|
||||
@@ -53,7 +52,6 @@ func NewZone(name, file string) *Zone {
|
||||
Tree: &tree.Tree{},
|
||||
Expired: new(bool),
|
||||
reloadShutdown: make(chan bool),
|
||||
LastReloaded: time.Now(),
|
||||
}
|
||||
*z.Expired = false
|
||||
return z
|
||||
|
||||
Reference in New Issue
Block a user