aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_replication.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-10-31 01:11:19 -0700
committerChris Lu <chris.lu@gmail.com>2018-10-31 01:11:19 -0700
commit4c97ff3717dc642fd2cad311a79df9ba266669cb (patch)
tree1c29716a587bb2f853439af6e0ebad88c906a82a /weed/command/filer_replication.go
parent200cbcde628d814eef44570076885651b3a0ed24 (diff)
downloadseaweedfs-4c97ff3717dc642fd2cad311a79df9ba266669cb.tar.xz
seaweedfs-4c97ff3717dc642fd2cad311a79df9ba266669cb.zip
support AWS SQS as file change notification message queue
Diffstat (limited to 'weed/command/filer_replication.go')
-rw-r--r--weed/command/filer_replication.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/command/filer_replication.go b/weed/command/filer_replication.go
index 05076143a..3ae4f1e2f 100644
--- a/weed/command/filer_replication.go
+++ b/weed/command/filer_replication.go
@@ -13,6 +13,7 @@ import (
_ "github.com/chrislusf/seaweedfs/weed/replication/sink/s3sink"
"github.com/chrislusf/seaweedfs/weed/server"
"github.com/spf13/viper"
+ "github.com/chrislusf/seaweedfs/weed/replication/sub"
)
func init() {
@@ -37,9 +38,9 @@ func runFilerReplicate(cmd *Command, args []string) bool {
weed_server.LoadConfiguration("replication", true)
config := viper.GetViper()
- var notificationInput replication.NotificationInput
+ var notificationInput sub.NotificationInput
- for _, input := range replication.NotificationInputs {
+ for _, input := range sub.NotificationInputs {
if config.GetBool("notification." + input.GetName() + ".enabled") {
viperSub := config.Sub("notification." + input.GetName())
if err := input.Initialize(viperSub); err != nil {
@@ -99,6 +100,10 @@ func runFilerReplicate(cmd *Command, args []string) bool {
glog.Errorf("receive %s: %+v", key, err)
continue
}
+ if key == "" {
+ // long poll received no messages
+ continue
+ }
if m.OldEntry != nil && m.NewEntry == nil {
glog.V(1).Infof("delete: %s", key)
} else if m.OldEntry == nil && m.NewEntry != nil {