diff options
Diffstat (limited to 'weed/server/filer_server.go')
| -rw-r--r-- | weed/server/filer_server.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 65fa26987..f4100e5b2 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -14,6 +14,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/notification" _ "github.com/chrislusf/seaweedfs/weed/notification/kafka" _ "github.com/chrislusf/seaweedfs/weed/notification/aws_sqs" + _ "github.com/chrislusf/seaweedfs/weed/notification/google_pub_sub" _ "github.com/chrislusf/seaweedfs/weed/notification/log" "github.com/chrislusf/seaweedfs/weed/security" "github.com/spf13/viper" @@ -52,6 +53,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) go fs.filer.KeepConnectedToMaster() LoadConfiguration("filer", true) + LoadConfiguration("notification", false) v := viper.GetViper() fs.filer.LoadConfiguration(v) @@ -81,15 +83,15 @@ func LoadConfiguration(configFileName string, required bool) { glog.V(0).Infof("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed()) - if err := viper.ReadInConfig(); err != nil { // Handle errors reading the config file + if err := viper.MergeInConfig(); err != nil { // Handle errors reading the config file glog.V(0).Infof("Reading %s: %v", viper.ConfigFileUsed(), err) if required { - glog.Errorf("Failed to load %s.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/"+ + glog.Fatalf("Failed to load %s.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/"+ "\n\nPlease follow this example and add a filer.toml file to "+ "current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/:\n"+ " https://github.com/chrislusf/seaweedfs/blob/master/weed/%s.toml\n"+ - "\n\nOr use this command to generate the default toml file\n"+ - " weed scaffold -config=%s -output=.\n", + "\nOr use this command to generate the default toml file\n"+ + " weed scaffold -config=%s -output=.\n\n\n", configFileName, configFileName, configFileName) } } |
