mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 21:29:52 +05:00
Exit automatic debit loops if debitStop channel was nil-led
This commit is contained in:
@@ -472,6 +472,11 @@ func (sS *SessionS) debitLoopSession(s *Session, sRunIdx int,
|
||||
}
|
||||
for {
|
||||
s.Lock()
|
||||
if s.debitStop == nil {
|
||||
// session already closed (most probably from sessionEnd), fixes concurrency
|
||||
s.Unlock()
|
||||
return
|
||||
}
|
||||
var maxDebit time.Duration
|
||||
if maxDebit, err = sS.debitSession(s, sRunIdx, dbtIvl, nil); err != nil {
|
||||
utils.Logger.Warning(
|
||||
|
||||
Reference in New Issue
Block a user