fix: initialize config once per startup (#9851)

This commit is contained in:
Harshavardhana
2020-06-16 20:15:21 -07:00
committed by GitHub
parent 3ba4804d6c
commit f5e1b3d09e
2 changed files with 30 additions and 23 deletions

View File

@@ -162,7 +162,9 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
srvCfg := newServerConfig()
// Override any values from ENVs.
lookupConfigs(srvCfg)
lookupConfigOnce.Do(func() {
lookupConfigs(srvCfg)
})
// hold the mutex lock before a new config is assigned.
globalServerConfigMu.Lock()