forked from TrueCloudLab/frostfs-s3-gw
[#478] Don't fetch epoch at object upload
Creation epoch was used for versioning. With tree service, versioning is done on the NeoFS side in the tree. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
9dfc7e043f
commit
4f3d206422
3 changed files with 24 additions and 36 deletions
|
@ -38,7 +38,6 @@ type (
|
|||
Size int64
|
||||
ContentType string
|
||||
Created time.Time
|
||||
CreationEpoch uint64
|
||||
HashSum string
|
||||
Owner user.ID
|
||||
Headers map[string]string
|
||||
|
|
|
@ -17,7 +17,6 @@ import (
|
|||
"github.com/nspcc-dev/neofs-s3-gw/api/cache"
|
||||
"github.com/nspcc-dev/neofs-s3-gw/api/data"
|
||||
apiErrors "github.com/nspcc-dev/neofs-s3-gw/api/errors"
|
||||
"github.com/nspcc-dev/neofs-s3-gw/internal/misc"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/client"
|
||||
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/object"
|
||||
|
@ -183,14 +182,6 @@ func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Object
|
|||
return nil, fmt.Errorf("couldn't add new verion to tree service: %w", err)
|
||||
}
|
||||
|
||||
currentEpoch, _, err := n.neoFS.TimeToEpoch(ctx, time.Now().Add(time.Minute))
|
||||
if err != nil {
|
||||
n.log.Warn("couldn't get creation epoch",
|
||||
zap.String("bucket", p.BktInfo.Name),
|
||||
zap.String("object", misc.SanitizeString(p.Object)),
|
||||
zap.Error(err))
|
||||
}
|
||||
|
||||
if p.Lock != nil && (p.Lock.Retention != nil || p.Lock.LegalHold != nil) {
|
||||
objVersion := &ObjectVersion{
|
||||
BktInfo: p.BktInfo,
|
||||
|
@ -214,7 +205,6 @@ func (n *layer) PutObject(ctx context.Context, p *PutObjectParams) (*data.Object
|
|||
Name: p.Object,
|
||||
Size: p.Size,
|
||||
Created: time.Now(),
|
||||
CreationEpoch: currentEpoch,
|
||||
Headers: p.Header,
|
||||
ContentType: p.Header[api.ContentType],
|
||||
HashSum: hex.EncodeToString(hash),
|
||||
|
|
|
@ -123,7 +123,6 @@ func objectInfoFromMeta(bkt *data.BucketInfo, meta *object.Object, prefix, delim
|
|||
Bucket: bkt.Name,
|
||||
Name: filename,
|
||||
Created: creation,
|
||||
CreationEpoch: meta.CreationEpoch(),
|
||||
ContentType: mimeType,
|
||||
Headers: userHeaders,
|
||||
Owner: *meta.OwnerID(),
|
||||
|
|
Loading…
Reference in a new issue