mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-03-11 19:18:43 +00:00
cli: use GET instead of HEAD in upload bin
Will be reverted when nspcc-dev/neofs-node#2988 is fixed. Currently HEAD request can return incorrect attributes, which can lead to incorrect index files. Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
parent
35d12779d6
commit
c955c1e4ea
1 changed files with 5 additions and 5 deletions
|
@ -377,11 +377,11 @@ func uploadIndexFiles(ctx *cli.Context, p *pool.Pool, containerID cid.ID, accoun
|
|||
go func() {
|
||||
defer wg.Done()
|
||||
for id := range oidCh {
|
||||
var obj *object.Object
|
||||
var obj object.Object
|
||||
errRetr := retry(func() error {
|
||||
var errGetHead error
|
||||
obj, errGetHead = p.ObjectHead(context.Background(), containerID, id, signer, client.PrmObjectHead{})
|
||||
return errGetHead
|
||||
var errGet error
|
||||
obj, _, errGet = p.ObjectGetInit(ctx.Context, containerID, id, signer, client.PrmObjectGet{})
|
||||
return errGet
|
||||
})
|
||||
if errRetr != nil {
|
||||
select {
|
||||
|
@ -589,7 +589,7 @@ func uploadObj(ctx context.Context, p *pool.Pool, signer user.Signer, owner util
|
|||
return nil
|
||||
}
|
||||
|
||||
func getBlockIndex(header *object.Object, attribute string) (int, error) {
|
||||
func getBlockIndex(header object.Object, attribute string) (int, error) {
|
||||
for _, attr := range header.UserAttributes() {
|
||||
if attr.Key() == attribute {
|
||||
value := attr.Value()
|
||||
|
|
Loading…
Add table
Reference in a new issue