[#1540] getSvc: Drop redundant returns
All checks were successful
Tests and linters / Run gofumpt (push) Successful in 2m9s
Vulncheck / Vulncheck (push) Successful in 2m51s
Tests and linters / Staticcheck (push) Successful in 3m20s
Build / Build Components (push) Successful in 3m40s
Pre-commit hooks / Pre-commit (push) Successful in 3m42s
Tests and linters / gopls check (push) Successful in 4m16s
Tests and linters / Tests (push) Successful in 4m42s
Tests and linters / Lint (push) Successful in 4m49s
Tests and linters / Tests with -race (push) Successful in 5m6s

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-12-05 10:32:30 +03:00 committed by Evgenii Stratonikov
parent 5fe78e51d1
commit 7df3520d48

View file

@ -240,13 +240,11 @@ func (a *assemblerec) tryGetChunkFromLocalStorage(ctx context.Context, ch object
object, err = a.localStorage.Head(ctx, addr, false)
if err != nil && !errors.Is(err, context.Canceled) {
a.log.Warn(ctx, logs.GetUnableToHeadPartECObject, zap.String("node", "local"), zap.Stringer("part_id", objID), zap.Error(err))
return nil
}
} else {
object, err = a.localStorage.Get(ctx, addr)
if err != nil && !errors.Is(err, context.Canceled) {
a.log.Warn(ctx, logs.GetUnableToGetPartECObject, zap.String("node", "local"), zap.Stringer("part_id", objID), zap.Error(err))
return nil
}
}
return object
@ -288,13 +286,11 @@ func (a *assemblerec) tryGetChunkFromRemoteStorage(ctx context.Context, node cli
object, err = a.remoteStorage.headObjectFromNode(ctx, addr, node, false)
if err != nil && !errors.Is(err, context.Canceled) {
a.log.Warn(ctx, logs.GetUnableToHeadPartECObject, zap.String("node", hex.EncodeToString(node.PublicKey())), zap.Stringer("part_id", objID), zap.Error(err))
return nil
}
} else {
object, err = a.remoteStorage.getObjectFromNode(ctx, addr, node)
if err != nil && !errors.Is(err, context.Canceled) {
a.log.Warn(ctx, logs.GetUnableToGetPartECObject, zap.String("node", hex.EncodeToString(node.PublicKey())), zap.Stringer("part_id", objID), zap.Error(err))
return nil
}
}
return object