mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 08:08:45 +05:00
tests passing on get max session time
This commit is contained in:
@@ -307,7 +307,7 @@ func (sm *FSSessionManager) LoopAction(s *Session, cd *engine.CallDescriptor, in
|
||||
s.sessionManager.DisconnectSession(s, SYSTEM_ERROR)
|
||||
}
|
||||
engine.Logger.Debug(fmt.Sprintf("Result of MaxDebit call: %v", cc))
|
||||
if cc.GetTotalDuration() == 0 || err != nil {
|
||||
if cc.GetDuration() == 0 || err != nil {
|
||||
engine.Logger.Info(fmt.Sprintf("No credit left: Disconnect %v", s))
|
||||
sm.DisconnectSession(s, INSUFFICIENT_FUNDS)
|
||||
return
|
||||
|
||||
@@ -87,7 +87,7 @@ func (s *Session) startDebitLoop() {
|
||||
}
|
||||
nextCd.TimeEnd = nextCd.TimeStart.Add(s.sessionManager.GetDebitPeriod())
|
||||
cc := s.sessionManager.LoopAction(s, &nextCd, index)
|
||||
time.Sleep(cc.GetTotalDuration())
|
||||
time.Sleep(cc.GetDuration())
|
||||
index++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user