diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go index 5011ca36e..b5cc02cfc 100644 --- a/weed/command/filer_remote_sync_dir.go +++ b/weed/command/filer_remote_sync_dir.go @@ -3,11 +3,12 @@ package command import ( "context" "fmt" - "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "os" "strings" "time" + "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" + "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/pb" @@ -40,9 +41,7 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour processEventFnWithOffset := pb.AddOffsetFunc(func(resp *filer_pb.SubscribeMetadataResponse) error { if resp.EventNotification.NewEntry != nil { if *option.storageClass == "" { - if _, ok := resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass]; ok { - delete(resp.EventNotification.NewEntry.Extended, s3_constants.AmzStorageClass) - } + delete(resp.EventNotification.NewEntry.Extended, s3_constants.AmzStorageClass) } else { resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass] = []byte(*option.storageClass) }