fix: always load ENVs from files first as soon as server starts (#18247)

This is a regression from #18231, however reading from ENV files
must happen well before any parsing logic is invoked.
This commit is contained in:
Harshavardhana 2023-10-15 21:13:43 -07:00 committed by GitHub
parent a2312028b9
commit edfb310a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -619,8 +619,6 @@ func loadEnvVarsFromFiles() {
} }
func handleCommonEnvVars() { func handleCommonEnvVars() {
loadEnvVarsFromFiles()
var err error var err error
globalBrowserEnabled, err = config.ParseBool(env.Get(config.EnvBrowser, config.EnableOn)) globalBrowserEnabled, err = config.ParseBool(env.Get(config.EnvBrowser, config.EnableOn))
if err != nil { if err != nil {

View File

@ -579,6 +579,9 @@ func serverMain(ctx *cli.Context) {
setDefaultProfilerRates() setDefaultProfilerRates()
// Always load ENV variables from files first.
loadEnvVarsFromFiles()
// Handle all server command args. // Handle all server command args.
bootstrapTrace("serverHandleCmdArgs", func() { bootstrapTrace("serverHandleCmdArgs", func() {
serverHandleCmdArgs(ctx) serverHandleCmdArgs(ctx)