fix(agent/agentssh): wait for sessions to exit (#8008)

This commit is contained in:
Mathias Fredriksson
2023-06-13 20:52:31 +03:00
committed by GitHub
parent 794a551176
commit 74fdcb1ace
+2
View File
@@ -648,9 +648,11 @@ func (s *Server) trackSession(ss ssh.Session, add bool) (ok bool) {
// Server closed.
return false
}
s.wg.Add(1)
s.sessions[ss] = struct{}{}
return true
}
s.wg.Done()
delete(s.sessions, ss)
return true
}