diff --git a/engine/libsuppliers.go b/engine/libsuppliers.go index 18013e64c..e937f6a4e 100644 --- a/engine/libsuppliers.go +++ b/engine/libsuppliers.go @@ -100,7 +100,8 @@ func (sSpls *SortedSuppliers) SortQOS(params []string) { if sSpls.SortedSuppliers[i].worstStats[param] == sSpls.SortedSuppliers[j].worstStats[param] { continue } - if sSpls.SortedSuppliers[i].worstStats[param] == -1 { + if (param != utils.MetaPDD && sSpls.SortedSuppliers[i].worstStats[param] == -1) || + (param == utils.MetaPDD && sSpls.SortedSuppliers[i].worstStats[param] == 1000000) { return false } switch param { diff --git a/engine/spls_qos.go b/engine/spls_qos.go index c6414df4e..d520aab68 100755 --- a/engine/spls_qos.go +++ b/engine/spls_qos.go @@ -68,9 +68,11 @@ func (lcs *QOSSupplierSorter) SortSuppliers(prflID string, suppls []*Supplier, } } } - if hasMetric == false { //if not have populate with default value - srtData[metric] = -1 - if metric == utils.MetaPDD { + if !hasMetric { //if not have populate with default value + switch metric { + default: + srtData[metric] = -1 + case utils.MetaPDD: srtData[metric] = 1000000 } }