Create Hosts object after the enable option has been checked.
This commit is contained in:
parent
d0956e90f5
commit
3f70c993a8
@ -73,7 +73,10 @@ func NewHandler() *GODNSHandler {
|
||||
panic("Invalid cache backend")
|
||||
}
|
||||
|
||||
hosts := NewHosts(settings.Hosts, settings.Redis)
|
||||
var hosts Hosts
|
||||
if settings.Hosts.Enable {
|
||||
hosts = NewHosts(settings.Hosts, settings.Redis)
|
||||
}
|
||||
|
||||
return &GODNSHandler{resolver, cache, negCache, hosts}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user