Skip to content

Commit

Permalink
config: make EnableSlowLog atomic
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Dec 2, 2021
1 parent 23f531e commit 1449522
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions config/config_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ func MergeConfigItems(dstConf, newConf *Config) (acceptedItems, rejectedItems []

func mergeConfigItems(dstConf, newConf reflect.Value, fieldPath string) (acceptedItems, rejectedItems []string) {
t := dstConf.Type()
if t.Name() == "AtomicBool" {
if reflect.DeepEqual(dstConf.Interface().(AtomicBool), newConf.Interface().(AtomicBool)) {
return
}
if _, ok := dynamicConfigItems[fieldPath]; ok {
dstConf.Set(newConf)
return []string{fieldPath}, nil
}
return nil, []string{fieldPath}
}
if t.Kind() == reflect.Ptr {
t = t.Elem()
dstConf = dstConf.Elem()
Expand Down

0 comments on commit 1449522

Please sign in to comment.