From 989def701a03bf785c4cf559837cc255f83e6cba Mon Sep 17 00:00:00 2001 From: "Q.s" Date: Mon, 27 Jan 2025 15:42:09 +0800 Subject: [PATCH] fix: move the comments back to the original location Signed-off-by: Q.s --- bootstrap/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/config/config.go b/bootstrap/config/config.go index 2930a60d..71bce361 100644 --- a/bootstrap/config/config.go +++ b/bootstrap/config/config.go @@ -281,8 +281,6 @@ func (cp *Processor) loadConfigByProvider( // TODO: figure out what uses the dic - this will not have the common config info!! // is this potentially custom config for app/device services? - // Must remove any settings in the config that are not actually present in the Config Provider - // Now merge only the actual present value with the existing configuration from common. cp.dic.Update(di.ServiceConstructorMap{ container.ConfigClientInterfaceName: func(get di.Get) any { return privateConfigClient @@ -307,12 +305,14 @@ func (cp *Processor) loadConfigByProvider( return err } + // Must remove any settings in the config that are not actually present in the Config Provider privateConfigKeys := utils.StringSliceToMap(configKeys) privateConfigMap, err := utils.RemoveUnusedSettings(privateServiceConfig, utils.BuildBaseKey(configStem, serviceKey), privateConfigKeys) if err != nil { return fmt.Errorf("could not remove unused settings from private configurations: %s", err.Error()) } + // Now merge only the actual present value with the existing configuration from common. if err := utils.MergeValues(serviceConfig, privateConfigMap); err != nil { return fmt.Errorf("could not merge common and private configurations: %s", err.Error()) }