Fix races (#17646)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9ef41a55e2
Коммит
14256f73be
@@ -179,9 +179,7 @@ func (s *Store) Set(newCfg *model.Config) (*model.Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
newCfg = newCfg.Clone()
|
newCfg = newCfg.Clone()
|
||||||
// no need to clone these as cached configs are getting replaced
|
oldCfg := s.config.Clone()
|
||||||
// with brand new objects.
|
|
||||||
oldCfg := s.config
|
|
||||||
oldCfgNoEnv := s.configNoEnv
|
oldCfgNoEnv := s.configNoEnv
|
||||||
|
|
||||||
// Setting defaults allows us to accept partial config objects.
|
// Setting defaults allows us to accept partial config objects.
|
||||||
@@ -255,7 +253,7 @@ func (s *Store) Load() error {
|
|||||||
|
|
||||||
oldCfg := &model.Config{}
|
oldCfg := &model.Config{}
|
||||||
if s.config != nil {
|
if s.config != nil {
|
||||||
oldCfg = s.config
|
oldCfg = s.config.Clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
configBytes, err := s.backingStore.Load()
|
configBytes, err := s.backingStore.Load()
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user