forked from TrueCloudLab/frostfs-s3-gw
[#441] Optimize put objects
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
6cf7dc4010
commit
2bca4755f9
6 changed files with 60 additions and 34 deletions
|
@ -41,17 +41,14 @@ func (n *layer) PutBucketCORS(ctx context.Context, p *PutCORSParams) error {
|
|||
Metadata: map[string]string{},
|
||||
Prefix: "",
|
||||
Reader: &buf,
|
||||
Size: int64(buf.Len()),
|
||||
}
|
||||
|
||||
obj, err := n.putSystemObjectIntoNeoFS(ctx, s)
|
||||
_, err := n.putSystemObjectIntoNeoFS(ctx, s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if obj.Size == 0 {
|
||||
return errors.GetAPIError(errors.ErrInternalError)
|
||||
}
|
||||
|
||||
if err = n.systemCache.PutCORS(systemObjectKey(p.BktInfo, s.ObjName), cors); err != nil {
|
||||
n.log.Error("couldn't cache system object", zap.Error(err))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue