mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 14:19:54 +05:00
Exit automatic debit loops if debitStop channel was nil-led, fixes #2354
This commit is contained in:
committed by
Dan Christian Bogos
parent
a513cd24fd
commit
4a9ef12123
@@ -520,6 +520,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