mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-25 00:58:45 +05:00
Add test for *load strategy from SupplierS
This commit is contained in:
committed by
Dan Christian Bogos
parent
743c4e8a38
commit
35130763bc
@@ -52,7 +52,13 @@ func (ws *LoadDistributionSorter) SortSuppliers(prflID string,
|
||||
return nil, err
|
||||
} else if pass && srtSpl != nil {
|
||||
// Add the ratio in SortingData so we can used it later in SortLoadDistribution
|
||||
srtSpl.SortingData[utils.Ratio] = s.cacheSupplier[utils.MetaRatio].(float64)
|
||||
floatRatio, err := utils.IfaceAsFloat64(s.cacheSupplier[utils.MetaRatio])
|
||||
if err != nil {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<%s> cannot convert ratio <%s> to float64 supplier: <%s>",
|
||||
utils.SupplierS, s.cacheSupplier[utils.MetaRatio], s.ID))
|
||||
}
|
||||
srtSpl.SortingData[utils.Ratio] = floatRatio
|
||||
sortedSuppls.SortedSuppliers = append(sortedSuppls.SortedSuppliers, srtSpl)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user