We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f269080 commit 95a292bCopy full SHA for 95a292b
configuration/configuration.go
@@ -166,9 +166,11 @@ type Configuration struct {
166
MapSync *MapSync `yaml:"-"`
167
}
168
169
+var cfgInitOnce sync.Once
170
+
171
// Get returns pointer to configuration
172
func Get() *Configuration {
- if cfg == nil {
173
+ cfgInitOnce.Do(func() {
174
cfg = &Configuration{}
175
cfg.initSignalHandler()
176
cfg.Notify.BootstrapKeyChanged = NewChanNotify()
@@ -188,7 +190,7 @@ func Get() *Configuration {
188
190
189
191
192
cfg.Cmdline.Store(sb.String())
- }
193
+ })
194
return cfg
195
196
0 commit comments