diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-09-16 01:18:30 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-09-16 01:18:30 -0700 |
| commit | d923ba2206a8238977e740f98f061242d61ed5e6 (patch) | |
| tree | a2fcaf40d5f2398b2b8ad3c2a77a22579597cc1c /weed/notification/configuration.go | |
| parent | bea4f6ca14615de23ba81a84cf61ba0f2a28b7f6 (diff) | |
| download | seaweedfs-d923ba2206a8238977e740f98f061242d61ed5e6.tar.xz seaweedfs-d923ba2206a8238977e740f98f061242d61ed5e6.zip | |
renaming msgqueue to notification
Diffstat (limited to 'weed/notification/configuration.go')
| -rw-r--r-- | weed/notification/configuration.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/weed/notification/configuration.go b/weed/notification/configuration.go new file mode 100644 index 000000000..6ac693ad8 --- /dev/null +++ b/weed/notification/configuration.go @@ -0,0 +1,33 @@ +package notification + +import ( + "github.com/chrislusf/seaweedfs/weed/glog" + "github.com/spf13/viper" +) + +var ( + MessageQueues []MessageQueue + + Queue MessageQueue +) + +func LoadConfiguration(config *viper.Viper) { + + if config == nil { + return + } + + for _, store := range MessageQueues { + if config.GetBool(store.GetName() + ".enabled") { + viperSub := config.Sub(store.GetName()) + if err := store.Initialize(viperSub); err != nil { + glog.Fatalf("Failed to initialize store for %s: %+v", + store.GetName(), err) + } + Queue = store + glog.V(0).Infof("Configure message queue for %s", store.GetName()) + return + } + } + +} |
