diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-01-28 02:39:22 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-01-28 02:39:22 -0800 |
| commit | 9a06c35da40b9d4b5b687b7300fed4196020f375 (patch) | |
| tree | 1aa516d4f95d0400c688ab3044a516bb84769cb1 /weed/replication/replicator.go | |
| parent | da08402ba253fe5391f0152905f51f82c51fd527 (diff) | |
| download | seaweedfs-9a06c35da40b9d4b5b687b7300fed4196020f375.tar.xz seaweedfs-9a06c35da40b9d4b5b687b7300fed4196020f375.zip | |
replicate: incremental sink only contains new and updated files
address https://github.com/chrislusf/seaweedfs/commit/da08402ba253fe5391f0152905f51f82c51fd527
Diffstat (limited to 'weed/replication/replicator.go')
| -rw-r--r-- | weed/replication/replicator.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go index 90e1f7cdd..7688029e6 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 cTime int64 + var mTime int64 if message.NewEntry != nil { - cTime = message.NewEntry.Attributes.Crtime + mTime = message.NewEntry.Attributes.Mtime } else if message.OldEntry != nil { - cTime = message.OldEntry.Attributes.Crtime + mTime = message.OldEntry.Attributes.Mtime } - dateKey = time.Unix(cTime, 0).Format("2006-01-02") + dateKey = time.Unix(mTime, 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) |
