make sure account is not cached

This commit is contained in:
Radu Ioan Fericean
2015-08-03 13:23:05 +03:00
parent 39a51dc826
commit 5e20dadfba
2 changed files with 2 additions and 2 deletions

View File

@@ -376,8 +376,7 @@ func (il RateIntervalList) Swap(i, j int) {
// we need higher weights earlyer in the list
func (il RateIntervalList) Less(j, i int) bool {
return il[i].Weight < il[j].Weight ||
il[i].Timing.StartTime > il[j].Timing.StartTime
return il[i].Weight < il[j].Weight //|| il[i].Timing.StartTime > il[j].Timing.StartTime
}
func (il RateIntervalList) Sort() {

View File

@@ -86,6 +86,7 @@ func (s *Session) debitLoop(runIdx int) {
//engine.Logger.Debug(fmt.Sprintf("NEXTCD: %s", utils.ToJSON(nextCd)))
nextCd.DurationIndex += debitPeriod // first presumed duration
cc := new(engine.CallCost)
nextCd.account = nil // make sure it is not cached
if err := s.sessionManager.Rater().MaxDebit(nextCd, cc); err != nil {
engine.Logger.Err(fmt.Sprintf("Could not complete debit opperation: %v", err))
s.sessionManager.DisconnectSession(s.eventStart, s.connId, SYSTEM_ERROR)