Merge branch 'master' of https://github.com/matrix-org/dendrite into add-nats-support

This commit is contained in:
Till Faelligen 2021-07-17 11:40:22 +02:00
commit af22fd97c5
2 changed files with 3 additions and 4 deletions

View file

@ -112,7 +112,7 @@ global:
# Maximum number of entries to hold in the DNS cache, and # Maximum number of entries to hold in the DNS cache, and
# for how long those items should be considered valid in seconds. # for how long those items should be considered valid in seconds.
cache_size: 256 cache_size: 256
cache_lifetime: 300 cache_lifetime: "5m" # 5minutes; see https://pkg.go.dev/time@master#ParseDuration for more
# Configuration for the Appservice API. # Configuration for the Appservice API.
app_service_api: app_service_api:

View file

@ -139,15 +139,14 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, useHTTPAPIs boo
var dnsCache *gomatrixserverlib.DNSCache var dnsCache *gomatrixserverlib.DNSCache
if cfg.Global.DNSCache.Enabled { if cfg.Global.DNSCache.Enabled {
lifetime := time.Second * cfg.Global.DNSCache.CacheLifetime
dnsCache = gomatrixserverlib.NewDNSCache( dnsCache = gomatrixserverlib.NewDNSCache(
cfg.Global.DNSCache.CacheSize, cfg.Global.DNSCache.CacheSize,
lifetime, cfg.Global.DNSCache.CacheLifetime,
) )
logrus.Infof( logrus.Infof(
"DNS cache enabled (size %d, lifetime %s)", "DNS cache enabled (size %d, lifetime %s)",
cfg.Global.DNSCache.CacheSize, cfg.Global.DNSCache.CacheSize,
lifetime, cfg.Global.DNSCache.CacheLifetime,
) )
} }