mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
use *mine_random as default strategy
This commit is contained in:
@@ -67,7 +67,7 @@ func (sg *SharedGroup) GetBalancesByStrategy(myBalance *Balance, bc BalanceChain
|
||||
}
|
||||
|
||||
strategy := STRATEGY_MINE_RANDOM
|
||||
if sharingParameters != nil {
|
||||
if sharingParameters != nil && sharingParameters.Strategy != "" {
|
||||
strategy = sharingParameters.Strategy
|
||||
}
|
||||
switch strategy {
|
||||
@@ -79,6 +79,11 @@ func (sg *SharedGroup) GetBalancesByStrategy(myBalance *Balance, bc BalanceChain
|
||||
rbc := RandomBalanceChainSorter(bc)
|
||||
(&rbc).Sort()
|
||||
bc = BalanceChain(rbc)
|
||||
default: // use mine random for anything else
|
||||
strategy = STRATEGY_MINE_RANDOM
|
||||
rbc := RandomBalanceChainSorter(bc)
|
||||
(&rbc).Sort()
|
||||
bc = BalanceChain(rbc)
|
||||
}
|
||||
if strings.HasPrefix(strategy, MINE_PREFIX) {
|
||||
// find index of my balance
|
||||
|
||||
Reference in New Issue
Block a user