mirror of
https://github.com/coredns/coredns.git
synced 2026-07-16 04:30:11 -04:00
plugin/file: Fix panic on zero-valued SOA refresh (#8276)
This PR fixes panic with zero-valued SOA refresh Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -152,9 +152,9 @@ Restart:
|
||||
return nil
|
||||
}
|
||||
soa := z.getSOA()
|
||||
refresh := time.Second * time.Duration(soa.Refresh)
|
||||
retry := time.Second * time.Duration(soa.Retry)
|
||||
expire := time.Second * time.Duration(soa.Expire)
|
||||
refresh := time.Second * time.Duration(max(soa.Refresh, 1))
|
||||
retry := time.Second * time.Duration(max(soa.Retry, 1))
|
||||
expire := time.Second * time.Duration(max(soa.Expire, 1))
|
||||
|
||||
refreshTicker := time.NewTicker(refresh)
|
||||
retryTicker := time.NewTicker(retry)
|
||||
|
||||
Reference in New Issue
Block a user