diff --git a/internal/home/clients.go b/internal/home/clients.go index d99bd632..6d3a6d23 100644 --- a/internal/home/clients.go +++ b/internal/home/clients.go @@ -294,6 +294,8 @@ func (clients *clientsContainer) forConfig() (objs []*clientObject) { UseGlobalBlockedServices: !cli.UseOwnBlockedServices, IgnoreQueryLog: cli.IgnoreQueryLog, IgnoreStatistics: cli.IgnoreStatistics, + UpstreamsCacheEnabled: cli.UpstreamsCacheEnabled, + UpstreamsCacheSize: cli.UpstreamsCacheSize, } objs = append(objs, o) diff --git a/internal/home/clientshttp.go b/internal/home/clientshttp.go index 62a46e78..d6fc2fc9 100644 --- a/internal/home/clientshttp.go +++ b/internal/home/clientshttp.go @@ -174,6 +174,12 @@ func (clients *clientsContainer) jsonToClient(cj clientJSON, prev *Client) (c *C return nil, fmt.Errorf("validating blocked services: %w", err) } + var upsCacheEnabled bool + var upsCacheSize uint32 + if prev != nil { + upsCacheEnabled, upsCacheSize = prev.UpstreamsCacheEnabled, prev.UpstreamsCacheSize + } + c = &Client{ safeSearchConf: safeSearchConf, @@ -192,6 +198,8 @@ func (clients *clientsContainer) jsonToClient(cj clientJSON, prev *Client) (c *C UseOwnBlockedServices: !cj.UseGlobalBlockedServices, IgnoreQueryLog: ignoreQueryLog, IgnoreStatistics: ignoreStatistics, + UpstreamsCacheEnabled: upsCacheEnabled, + UpstreamsCacheSize: upsCacheSize, } if safeSearchConf.Enabled {