mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-08 00:24:23 +08:00
avoid concurrent map updates to viper
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user