refactor(session): add registry to manage SSH sessions
All checks were successful
renovate / renovate (push) Successful in 36s
Docker Build and Push / build-and-push-branches (push) Successful in 4m41s
Docker Build and Push / build-and-push-tags (push) Successful in 4m38s

- Implement thread-safe session registry with sync.RWMutex
- Add Registry interface for session management operations
- Support Get, Register, Update, and Remove session operations
- Enable dynamic slug updates for existing sessions
- Fix Connection closed by remote because HandleTCPIPForward run on a goroutine
This commit is contained in:
2025-12-31 18:33:47 +07:00
parent f8a6f0bafe
commit 9276430fae
3 changed files with 6 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ func (s *SSHSession) Start() error {
s.lifecycle.SetChannel(ch)
s.interaction.SetChannel(ch)
go s.HandleTCPIPForward(tcpipReq)
s.HandleTCPIPForward(tcpipReq)
if err := s.lifecycle.Close(); err != nil {
log.Printf("failed to close session: %v", err)