aboutsummaryrefslogtreecommitdiff
path: root/weed/replication/replicator.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-28 02:17:41 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-28 02:17:41 -0800
commitda08402ba253fe5391f0152905f51f82c51fd527 (patch)
tree3f62e21364b01ff9f15768b6c898df99554a5869 /weed/replication/replicator.go
parent822f1ade9d3f613e4f400ed0945f52b3bbba3780 (diff)
downloadseaweedfs-da08402ba253fe5391f0152905f51f82c51fd527.tar.xz
seaweedfs-da08402ba253fe5391f0152905f51f82c51fd527.zip
replicate: use creation time for local incremental file sink
related to https://github.com/chrislusf/seaweedfs/pull/1762
Diffstat (limited to 'weed/replication/replicator.go')
-rw-r--r--weed/replication/replicator.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go
index 7688029e6..90e1f7cdd 100644
--- a/weed/replication/replicator.go
+++ b/weed/replication/replicator.go
@@ -43,13 +43,13 @@ func (r *Replicator) Replicate(ctx context.Context, key string, message *filer_p
}
var dateKey string
if r.sink.GetName() == "local_incremental" {
- var mTime int64
+ var cTime int64
if message.NewEntry != nil {
- mTime = message.NewEntry.Attributes.Mtime
+ cTime = message.NewEntry.Attributes.Crtime
} else if message.OldEntry != nil {
- mTime = message.OldEntry.Attributes.Mtime
+ cTime = message.OldEntry.Attributes.Crtime
}
- dateKey = time.Unix(mTime, 0).Format("2006-01-02")
+ dateKey = time.Unix(cTime, 0).Format("2006-01-02")
}
newKey := util.Join(r.sink.GetSinkToDirectory(), dateKey, key[len(r.source.Dir):])
glog.V(3).Infof("replicate %s => %s", key, newKey)