[#441] Optimize put objects

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-05-25 18:59:36 +03:00 committed by Alex Vanin
parent 6cf7dc4010
commit 2bca4755f9
6 changed files with 60 additions and 34 deletions

View file

@ -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))
}