mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-08 15:36:14 +08:00
avoid concurrent map updates to viper
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"github.com/chrislusf/seaweedfs/weed/glog"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type MessageQueue interface {
|
||||
@@ -21,7 +20,7 @@ var (
|
||||
Queue MessageQueue
|
||||
)
|
||||
|
||||
func LoadConfiguration(config *viper.Viper, prefix string) {
|
||||
func LoadConfiguration(config *util.ViperProxy, prefix string) {
|
||||
|
||||
if config == nil {
|
||||
return
|
||||
@@ -43,7 +42,7 @@ func LoadConfiguration(config *viper.Viper, prefix string) {
|
||||
|
||||
}
|
||||
|
||||
func validateOneEnabledQueue(config *viper.Viper) {
|
||||
func validateOneEnabledQueue(config *util.ViperProxy) {
|
||||
enabledQueue := ""
|
||||
for _, queue := range MessageQueues {
|
||||
if config.GetBool(queue.GetName() + ".enabled") {
|
||||
|
||||
Reference in New Issue
Block a user