Command line option for disabling the cache
This commit is contained in:
1 parent
fe672eae63
commit
44cdf3bca3
1 file changed
+10
-9
+10
-9
@@ -27,6 +27,7 @@ func main() {
|
|||||||
refreshInterval int
|
refreshInterval int
|
||||||
relevantTime int
|
relevantTime int
|
||||||
cacheLen int
|
cacheLen int
|
||||||
|
cacheDisabled bool
|
||||||
watch bool
|
watch bool
|
||||||
debug bool
|
debug bool
|
||||||
err error
|
err error
|
||||||
@@ -39,14 +40,16 @@ func main() {
|
|||||||
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
|
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
|
||||||
flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests")
|
flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests")
|
||||||
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
|
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
|
||||||
flag.IntVar(&timeout, "timeout", weavedns.DefaultTimeout, "timeout for resolutions")
|
|
||||||
flag.IntVar(&udpbuf, "udpbuf", weavedns.DefaultUDPBuflen, "UDP buffer length")
|
|
||||||
flag.IntVar(&cacheLen, "cache", weavedns.DefaultCacheLen, "cache length")
|
flag.IntVar(&cacheLen, "cache", weavedns.DefaultCacheLen, "cache length")
|
||||||
flag.BoolVar(&watch, "watch", true, "watch the docker socket for container events")
|
flag.BoolVar(&watch, "watch", true, "watch the docker socket for container events")
|
||||||
flag.BoolVar(&debug, "debug", false, "output debugging info to stderr")
|
flag.BoolVar(&debug, "debug", false, "output debugging info to stderr")
|
||||||
// advanced options
|
// advanced options
|
||||||
flag.IntVar(&refreshInterval, "refresh", weavedns.DefaultRefreshInterval, "refresh interval (in secs) for local names (0=disable)")
|
flag.IntVar(&refreshInterval, "refresh", weavedns.DefaultRefreshInterval, "refresh interval (in secs) for local names (0=disable)")
|
||||||
flag.IntVar(&relevantTime, "relevant", weavedns.DefaultRelevantTime, "life time for info in the absence of queries (in secs)")
|
flag.IntVar(&relevantTime, "relevant", weavedns.DefaultRelevantTime, "life time for info in the absence of queries (in secs)")
|
||||||
|
flag.IntVar(&udpbuf, "udpbuf", weavedns.DefaultUDPBuflen, "UDP buffer length")
|
||||||
|
flag.IntVar(&timeout, "timeout", weavedns.DefaultTimeout, "timeout for resolutions (in millisecs)")
|
||||||
|
flag.BoolVar(&cacheDisabled, "no-cache", false, "disable the cache")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if justVersion {
|
if justVersion {
|
||||||
@@ -93,18 +96,16 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
srvConfig := weavedns.DNSServerConfig{
|
srvConfig := weavedns.DNSServerConfig{
|
||||||
Port: dnsPort,
|
Port: dnsPort,
|
||||||
CacheLen: cacheLen,
|
CacheLen: cacheLen,
|
||||||
LocalDomain: domain,
|
Timeout: timeout,
|
||||||
Timeout: timeout,
|
UDPBufLen: udpbuf,
|
||||||
UDPBufLen: udpbuf,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Error.Fatal("Failed to initialize the WeaveDNS server", err)
|
Error.Fatal("[main] Failed to initialize the WeaveDNS server", err)
|
||||||
}
|
}
|
||||||
Info.Println("Upstream", srv.Upstream)
|
|
||||||
|
|
||||||
go SignalHandlerLoop(srv)
|
go SignalHandlerLoop(srv)
|
||||||
go weavedns.ListenHTTP(version, srv, domain, zone, httpPort)
|
go weavedns.ListenHTTP(version, srv, domain, zone, httpPort)
|
||||||
|
|||||||
Reference in new issue
Block a user