Konstantin Lebedev
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
4 deletions
-
weed/command/filer_remote_sync_dir.go
|
@ -37,11 +37,16 @@ func followUpdatesAndUploadToRemote(option *RemoteSyncOptions, filerSource *sour |
|
|
|
|
|
|
|
|
var lastLogTsNs = time.Now().UnixNano() |
|
|
var lastLogTsNs = time.Now().UnixNano() |
|
|
processEventFnWithOffset := pb.AddOffsetFunc(func(resp *filer_pb.SubscribeMetadataResponse) error { |
|
|
processEventFnWithOffset := pb.AddOffsetFunc(func(resp *filer_pb.SubscribeMetadataResponse) error { |
|
|
|
|
|
if resp.EventNotification.NewEntry != nil { |
|
|
if *option.storageClass == "" { |
|
|
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 { |
|
|
} else { |
|
|
resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass] = []byte(*option.storageClass) |
|
|
resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass] = []byte(*option.storageClass) |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
processor.AddSyncJob(resp) |
|
|
processor.AddSyncJob(resp) |
|
|
return nil |
|
|
return nil |
|
|
}, 3*time.Second, func(counter int64, lastTsNs int64) error { |
|
|
}, 3*time.Second, func(counter int64, lastTsNs int64) error { |
|
|