mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
Warning instead of Error for going on negative on account, defer file close for cpu_profiling
This commit is contained in:
@@ -505,7 +505,7 @@ func (ub *Account) debitCreditBalance(cd *CallDescriptor, count bool, dryRun boo
|
||||
// get the default money balanance
|
||||
// and go negative on it with the amount still unpaid
|
||||
if len(leftCC.Timespans) > 0 && leftCC.Cost > 0 && !ub.AllowNegative && !dryRun {
|
||||
utils.Logger.Err(fmt.Sprintf("<Rater> Going negative on account %s with AllowNegative: false", cd.GetAccountKey()))
|
||||
utils.Logger.Warning(fmt.Sprintf("<Rater> Going negative on account %s with AllowNegative: false", cd.GetAccountKey()))
|
||||
}
|
||||
leftCC.Timespans.Decompress()
|
||||
for tsIndex, ts := range leftCC.Timespans {
|
||||
|
||||
@@ -483,7 +483,7 @@ func (b *Balance) debitUnits(cd *CallDescriptor, ub *Account, moneyBalances Bala
|
||||
}
|
||||
}
|
||||
if cost != 0 && moneyBal == nil && (!dryRun || ub.AllowNegative) { // Fix for issue #685
|
||||
utils.Logger.Err(fmt.Sprintf("<RALs> Going negative on account %s with AllowNegative: false", cd.GetAccountKey()))
|
||||
utils.Logger.Warning(fmt.Sprintf("<RALs> Going negative on account %s with AllowNegative: false", cd.GetAccountKey()))
|
||||
moneyBal = ub.GetDefaultMoneyBalance()
|
||||
}
|
||||
if (cost == 0 || moneyBal != nil) && b.GetValue() >= amount {
|
||||
|
||||
Reference in New Issue
Block a user