forked from TrueCloudLab/frostfs-node
[#488] storage/calculator: Make alpha
dynamic
Delete reading `alpha` from env var. Cover retrieving `alpha` behind interface in intermediate calculator. Add TODO to decide if it is necessary to receive that param from global config or not. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
ad4a55468e
commit
2c8c9f69c8
6 changed files with 34 additions and 14 deletions
|
@ -24,6 +24,18 @@ func (p *CalculatePrm) SetEpochIteration(ei eigentrust.EpochIteration) {
|
|||
}
|
||||
|
||||
func (c *Calculator) Calculate(prm CalculatePrm) {
|
||||
alpha, err := c.prm.AlphaProvider.EigenTrustAlpha()
|
||||
if err != nil {
|
||||
c.opts.log.Debug(
|
||||
"failed to get alpha param",
|
||||
zap.Error(err),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
c.alpha = reputation.TrustValueFromFloat64(alpha)
|
||||
c.beta = reputation.TrustValueFromFloat64(1 - alpha)
|
||||
|
||||
ctx := eigentrust.IterContext{
|
||||
Context: context.Background(),
|
||||
EpochIteration: prm.ei,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue