Clean up shutdownSessions

This commit is contained in:
MoofMonkey 2022-10-05 02:31:09 +03:00
parent 3260fa88ab
commit 67e59cb35c
1 changed files with 3 additions and 3 deletions

View File

@ -88,10 +88,10 @@ func (m *manager) shutdownSessions(err error) {
}
closeSessionErr := &errClosedSession{
message: err.Error(),
// Usually connection with remote has been closed, so set this to true to skip unregistering from remote
// context.Canceled is an exception because that means session is being closed by our side
byRemote: !errors.Is(err, context.Canceled),
}
// Usually connection with remote has been closed, so set this to true to skip unregistering from remote
// context.Canceled is an exception because that means session is being closed by our side
closeSessionErr.byRemote = !errors.Is(err, context.Canceled)
for _, s := range m.sessions {
s.close(closeSessionErr)
}