From 5e0e52a456f8a7e27e47d79ae3f32746a62fd706 Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Mon, 8 Feb 2021 17:56:15 +0200 Subject: [PATCH] Changed the function in order to cover --- sessions/sessions.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sessions/sessions.go b/sessions/sessions.go index 4eb952790..1abf1ad4c 100644 --- a/sessions/sessions.go +++ b/sessions/sessions.go @@ -1331,7 +1331,6 @@ func (sS *SessionS) syncSessions() { utils.Logger.Warning( fmt.Sprintf("<%s> timeout quering session ids ", utils.SessionS)) } - } var toBeRemoved []string sS.aSsMux.RLock() @@ -1341,6 +1340,11 @@ func (sS *SessionS) syncSessions() { } } sS.aSsMux.RUnlock() + sS.terminateSyncSessions(toBeRemoved) +} + +// Extracted from syncSessions in order to test all cases +func (sS *SessionS) terminateSyncSessions(toBeRemoved []string) { for _, cgrID := range toBeRemoved { ss := sS.getSessions(cgrID, false) if len(ss) == 0 {