forked from TrueCloudLab/frostfs-node
[#212] reputationsvc: Resolve funlen linter
Resolve funlen linter for Calculator.iterateDaughter method. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
7ebbfa3358
commit
c236b54a65
1 changed files with 60 additions and 53 deletions
|
@ -101,7 +101,6 @@ type iterDaughterPrm struct {
|
|||
consumersIter TrustIterator
|
||||
}
|
||||
|
||||
// nolint: funlen
|
||||
func (c *Calculator) iterateDaughter(ctx context.Context, p iterDaughterPrm) {
|
||||
initTrust, err := c.prm.InitialTrustSource.InitialTrust(p.id)
|
||||
if err != nil {
|
||||
|
@ -157,6 +156,13 @@ func (c *Calculator) iterateDaughter(ctx context.Context, p iterDaughterPrm) {
|
|||
intermediateTrust.SetI(p.ei.I())
|
||||
|
||||
if p.lastIter {
|
||||
c.processLastIteration(p, intermediateTrust, sum)
|
||||
} else {
|
||||
c.processIntermediateIteration(ctx, p, daughterIter, sum)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Calculator) processLastIteration(p iterDaughterPrm, intermediateTrust eigentrust.IterationTrust, sum reputation.TrustValue) {
|
||||
finalWriter, err := c.prm.FinalResultTarget.InitIntermediateWriter(p.ei)
|
||||
if err != nil {
|
||||
c.opts.log.Debug("init writer failure",
|
||||
|
@ -176,7 +182,9 @@ func (c *Calculator) iterateDaughter(ctx context.Context, p iterDaughterPrm) {
|
|||
|
||||
return
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
func (c *Calculator) processIntermediateIteration(ctx context.Context, p iterDaughterPrm, daughterIter TrustIterator, sum reputation.TrustValue) {
|
||||
intermediateWriter, err := c.prm.IntermediateValueTarget.InitWriter(p.ei)
|
||||
if err != nil {
|
||||
c.opts.log.Debug("init writer failure",
|
||||
|
@ -220,7 +228,6 @@ func (c *Calculator) iterateDaughter(ctx context.Context, p iterDaughterPrm) {
|
|||
zap.String("error", err.Error()),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Calculator) sendInitialValues(ctx context.Context, epochInfo EpochIterationInfo) {
|
||||
|
|
Loading…
Reference in a new issue