Updated syncSessions

This commit is contained in:
Trial97
2021-08-20 11:25:37 +03:00
committed by Dan Christian Bogos
parent e4427f8ce7
commit 53a7059e06

View File

@@ -1352,6 +1352,12 @@ func (sS *SessionS) getRelocateSession(cgrID string, initOriginID,
// syncSessions synchronizes the active sessions with the one in the clients
// it will force-disconnect the one found in SessionS but not in clients
func (sS *SessionS) syncSessions() {
sS.aSsMux.RLock()
asCount := len(sS.aSessions)
sS.aSsMux.RUnlock()
if asCount == 0 { // no need to sync the sessions if none is active
return
}
queriedCGRIDs := engine.NewSafEvent(nil) // need this to be
var err error
for _, clnt := range sS.biJClients() {