mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
middleware/file: don't reload zone when SOA isn't changed (#707)
* middleware/file: don't reload zone when SOA isn't changed Give Parse an extra argument which is the SOA's serial, if > 0 we check against the just parsed SOA and then just return. Most notable use is in reload.go which is both used in the file and auto middleware. Fixes #415 * PR comments
This commit is contained in:
@@ -45,9 +45,10 @@ func (a Auto) Walk() error {
|
||||
}
|
||||
defer reader.Close()
|
||||
|
||||
zo, err := file.Parse(reader, origin, path)
|
||||
// Serial for loading a zone is 0, because it is a new zone.
|
||||
zo, err := file.Parse(reader, origin, path, 0)
|
||||
if err != nil {
|
||||
// Parse barfs warning by itself...
|
||||
log.Printf("[WARNING] Parse zone `%s': %v", origin, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user