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
|
return settings, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settings := &data.BucketSettings{}
|
||||||
|
|
||||||
obj, err := n.getSystemObjectFromNeoFS(ctx, bktInfo, bktInfo.SettingsObjectName())
|
obj, err := n.getSystemObjectFromNeoFS(ctx, bktInfo, bktInfo.SettingsObjectName())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.IsS3Error(err, errors.ErrNoSuchKey) {
|
if !errors.IsS3Error(err, errors.ErrNoSuchKey) {
|
||||||
return &data.BucketSettings{}, nil
|
|
||||||
}
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
} else if err = json.Unmarshal(obj.Payload(), settings); err != nil {
|
||||||
settings := &data.BucketSettings{}
|
|
||||||
if err = json.Unmarshal(obj.Payload(), settings); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue