mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
destination rate selection fixes
This commit is contained in:
@@ -360,6 +360,18 @@ func (ri *RateInterval) GetMaxCost() (float64, string) {
|
||||
// Structure to store intervals according to weight
|
||||
type RateIntervalList []*RateInterval
|
||||
|
||||
func (rl RateIntervalList) GetWeight() float64 {
|
||||
// all reates should have the same weight
|
||||
// just in case get the max
|
||||
var maxWeight float64
|
||||
for _, r := range rl {
|
||||
if r.Weight > maxWeight {
|
||||
maxWeight = r.Weight
|
||||
}
|
||||
}
|
||||
return maxWeight
|
||||
}
|
||||
|
||||
// Structure to store intervals according to weight
|
||||
type RateIntervalTimeSorter struct {
|
||||
referenceTime time.Time
|
||||
|
||||
Reference in New Issue
Block a user