aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer_sync.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-25 01:17:26 -0800
committerchrislu <chris.lu@gmail.com>2022-02-25 01:17:26 -0800
commit202a29d014c39f4489c9428d04400b2b6adf0943 (patch)
treeb8c472adc922af3091357627efd3176ba0eb901b /weed/command/filer_sync.go
parent91d6785cf3d6233ac7fc5f77c29b549dbd7da610 (diff)
downloadseaweedfs-202a29d014c39f4489c9428d04400b2b6adf0943.tar.xz
seaweedfs-202a29d014c39f4489c9428d04400b2b6adf0943.zip
refactoring
Diffstat (limited to 'weed/command/filer_sync.go')
-rw-r--r--weed/command/filer_sync.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index 172be6a9a..37ce2aa73 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -262,7 +262,7 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
}
// handle deletions
- if message.OldEntry != nil && message.NewEntry == nil {
+ if filer_pb.IsDelete(resp) {
if !strings.HasPrefix(string(sourceOldKey), sourcePath) {
return nil
}
@@ -271,7 +271,7 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
}
// handle new entries
- if message.OldEntry == nil && message.NewEntry != nil {
+ if filer_pb.IsCreate(resp) {
if !strings.HasPrefix(string(sourceNewKey), sourcePath) {
return nil
}
@@ -280,7 +280,7 @@ func genProcessFunction(sourcePath string, targetPath string, dataSink sink.Repl
}
// this is something special?
- if message.OldEntry == nil && message.NewEntry == nil {
+ if filer_pb.IsEmpty(resp) {
return nil
}