[#156] object/get: Make toHeadPrm() pass gocognit
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
All checks were successful
ci/woodpecker/push/pre-commit Pipeline was successful
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
484ac502ca
commit
cbc2efb1d6
1 changed files with 133 additions and 131 deletions
|
@ -426,7 +426,7 @@ func (w *headResponseWriter) WriteHeader(_ context.Context, hdr *object.Object)
|
|||
return nil
|
||||
}
|
||||
|
||||
// nolint: funlen, gocognit
|
||||
// nolint: funlen
|
||||
func (s *Service) toHeadPrm(ctx context.Context, req *objectV2.HeadRequest, resp *objectV2.HeadResponse) (*getsvc.HeadPrm, error) {
|
||||
body := req.GetBody()
|
||||
|
||||
|
@ -459,7 +459,10 @@ func (s *Service) toHeadPrm(ctx context.Context, req *objectV2.HeadRequest, resp
|
|||
body: resp.GetBody(),
|
||||
})
|
||||
|
||||
if !commonPrm.LocalOnly() {
|
||||
if commonPrm.LocalOnly() {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
var onceResign sync.Once
|
||||
|
||||
p.SetRequestForwarder(groupAddressRequestForwarder(func(addr network.Address, c client.MultiAddressClient, pubkey []byte) (*object.Object, error) {
|
||||
|
@ -589,7 +592,6 @@ func (s *Service) toHeadPrm(ctx context.Context, req *objectV2.HeadRequest, resp
|
|||
// convert the object
|
||||
return obj, nil
|
||||
}))
|
||||
}
|
||||
|
||||
return p, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue