- Ready for presentation
This commit is contained in:
Tim Beatham 2024-01-17 14:52:09 +00:00
parent 41d41694a6
commit 915263e49a

View File

@ -143,14 +143,13 @@ func (m *ConnectionManagerImpl) RemoveConnection(endPoint string) error {
m.conLoc.Lock() m.conLoc.Lock()
connection, ok := m.clientConnections[endPoint] connection, ok := m.clientConnections[endPoint]
if !ok { var err error
// nothing to do if no connection
return nil if ok {
err = connection.Close()
delete(m.clientConnections, endPoint)
} }
err := connection.Close()
delete(m.clientConnections, endPoint)
m.conLoc.Unlock() m.conLoc.Unlock()
return err return err
} }