diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-25 01:17:26 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-25 01:17:26 -0800 |
| commit | 202a29d014c39f4489c9428d04400b2b6adf0943 (patch) | |
| tree | b8c472adc922af3091357627efd3176ba0eb901b /weed/command/filer_remote_sync_dir.go | |
| parent | 91d6785cf3d6233ac7fc5f77c29b549dbd7da610 (diff) | |
| download | seaweedfs-202a29d014c39f4489c9428d04400b2b6adf0943.tar.xz seaweedfs-202a29d014c39f4489c9428d04400b2b6adf0943.zip | |
refactoring
Diffstat (limited to 'weed/command/filer_remote_sync_dir.go')
| -rw-r--r-- | weed/command/filer_remote_sync_dir.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index ccedc9d80..5859645e9 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -91,10 +91,10 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, return handleEtcRemoteChanges(resp) } - if message.OldEntry == nil && message.NewEntry == nil { + if filer_pb.IsEmpty(resp) { return nil } - if message.OldEntry == nil && message.NewEntry != nil { + if filer_pb.IsCreate(resp) { if !filer.HasData(message.NewEntry) { return nil } @@ -115,7 +115,7 @@ func makeEventProcessor(remoteStorage *remote_pb.RemoteConf, mountedDir string, } return updateLocalEntry(&remoteSyncOptions, message.NewParentPath, message.NewEntry, remoteEntry) } - if message.OldEntry != nil && message.NewEntry == nil { + if filer_pb.IsDelete(resp) { glog.V(2).Infof("delete: %+v", resp) dest := toRemoteStorageLocation(util.FullPath(mountedDir), util.NewFullPath(resp.Directory, message.OldEntry.Name), remoteStorageMountLocation) if message.OldEntry.IsDirectory { |
