mirror of
https://github.com/chrislusf/seaweedfs
synced 2024-07-05 00:26:51 +02:00
fix delete key panic of remote sync dir (#3770)
This commit is contained in:
parent
c3487d3da7
commit
6fa3d0cc46
|
@ -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 *option.storageClass == "" {
|
if resp.EventNotification.NewEntry != nil {
|
||||||
delete(resp.EventNotification.NewEntry.Extended, s3_constants.AmzStorageClass)
|
if *option.storageClass == "" {
|
||||||
} else {
|
if _, ok := resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass]; ok {
|
||||||
resp.EventNotification.NewEntry.Extended[s3_constants.AmzStorageClass] = []byte(*option.storageClass)
|
delete(resp.EventNotification.NewEntry.Extended, s3_constants.AmzStorageClass)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue