diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-11-01 01:11:09 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-11-01 01:11:09 -0700 |
| commit | db584ff7f8e6b5564ebab66fbe544bd6f626159d (patch) | |
| tree | db9103a472649aea2a196c806e1fd74cf9b3b56e /weed/server/filer_server.go | |
| parent | 6219a9ad1f0bb4efd3bee736285872b22aa6e352 (diff) | |
| download | seaweedfs-db584ff7f8e6b5564ebab66fbe544bd6f626159d.tar.xz seaweedfs-db584ff7f8e6b5564ebab66fbe544bd6f626159d.zip | |
separate into notification.toml, add gcp pub/sub message queue
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) } } |
