Skip to content

Commit

Permalink
added mux
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Schou-Andreasen committed Apr 16, 2021
1 parent d016cff commit 2c82124
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,18 @@ func InitializeConfig(cfg interface{}, project string, envFileAction EnvFileActi
return nil
}

var mux sync.Mutex

func (svc *secretClient) setValueFromGcp(p params) error {
secretString, err := svc.accessSecretVersion(p.name)
if err != nil {
return err
}

if p.viper != nil {
mux.Lock()
p.viper.Set(p.name, secretString)
mux.Unlock()
}

p.v.SetString(string(secretString))
Expand Down

0 comments on commit 2c82124

Please sign in to comment.