avoid concurrent map updates to viper

This commit is contained in:
Chris Lu
2021-01-12 02:28:13 -08:00
parent 38d516251e
commit cfb9342a15
6 changed files with 26 additions and 17 deletions

View File

@@ -3,17 +3,16 @@ package security
import (
"crypto/tls"
"crypto/x509"
"github.com/chrislusf/seaweedfs/weed/util"
"io/ioutil"
"github.com/spf13/viper"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"github.com/chrislusf/seaweedfs/weed/glog"
)
func LoadServerTLS(config *viper.Viper, component string) grpc.ServerOption {
func LoadServerTLS(config *util.ViperProxy, component string) grpc.ServerOption {
if config == nil {
return nil
}
@@ -40,7 +39,7 @@ func LoadServerTLS(config *viper.Viper, component string) grpc.ServerOption {
return grpc.Creds(ta)
}
func LoadClientTLS(config *viper.Viper, component string) grpc.DialOption {
func LoadClientTLS(config *util.ViperProxy, component string) grpc.DialOption {
if config == nil {
return grpc.WithInsecure()
}