From b1b8c4ed328a3bc1d2bdcaa3337979096ff0c008 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 23 Sep 2018 01:46:50 -0700 Subject: [PATCH] join via filepath --- weed/replication/replicator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go index 5884bd35b..215be5992 100644 --- a/weed/replication/replicator.go +++ b/weed/replication/replicator.go @@ -1,6 +1,7 @@ package replication import ( + "path/filepath" "strings" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" @@ -35,7 +36,7 @@ func (r *Replicator) Replicate(key string, message *filer_pb.EventNotification) if !strings.HasPrefix(key, r.source.Dir) { return nil } - key = r.sink.GetSinkToDirectory() + key[len(r.source.Dir):] + key = filepath.Join(r.sink.GetSinkToDirectory(), key[len(r.source.Dir):]) if message.OldEntry != nil && message.NewEntry == nil { return r.sink.DeleteEntry(key, message.OldEntry, message.DeleteChunks) }