forked from TrueCloudLab/frostfs-s3-gw
[#439] Less cache misses for empty bucket setting
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1012a3c6a4
commit
2575462daa
1 changed files with 5 additions and 7 deletions
|
@ -238,16 +238,14 @@ func (n *layer) GetBucketSettings(ctx context.Context, bktInfo *data.BucketInfo)
|
|||
return settings, nil
|
||||
}
|
||||
|
||||
settings := &data.BucketSettings{}
|
||||
|
||||
obj, err := n.getSystemObjectFromNeoFS(ctx, bktInfo, bktInfo.SettingsObjectName())
|
||||
if err != nil {
|
||||
if errors.IsS3Error(err, errors.ErrNoSuchKey) {
|
||||
return &data.BucketSettings{}, nil
|
||||
if !errors.IsS3Error(err, errors.ErrNoSuchKey) {
|
||||
return nil, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
settings := &data.BucketSettings{}
|
||||
if err = json.Unmarshal(obj.Payload(), settings); err != nil {
|
||||
} else if err = json.Unmarshal(obj.Payload(), settings); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue