| commit | 37aea50d9d9dff848c9c1a329a5d5d91082eef10 | [log] [tgz] |
|---|---|---|
| author | Sundar Ramamoorthy <sramamoorthy@apigee.com> | Thu Mar 16 14:35:53 2017 -0700 |
| committer | Sundar Ramamoorthy <sramamoorthy@apigee.com> | Thu Mar 16 14:35:53 2017 -0700 |
| tree | fae3e073cfe8b91e90f7d49bf7470e872449f9d4 | |
| parent | 191a7900e5d3c71ee08fd87f793da9374040391d [diff] |
The config structure itself is a critical section.
diff --git a/config/config.go b/config/config.go index 996a0d3..b9e9a94 100644 --- a/config/config.go +++ b/config/config.go
@@ -24,6 +24,8 @@ defaultConfigPath = "." ) +var configlock sync.Mutex + type ConfigMgr struct { sync.Mutex vcfg *viper.Viper @@ -87,6 +89,8 @@ } func GetConfig() apid.ConfigService { + configlock.Lock() + defer configlock.Unlock() if cfg == nil { vcfg := viper.New()