refactor: inject SessionRegistry interface instead of individual functions

This commit is contained in:
2026-01-05 16:44:03 +07:00
parent f25d61d1d1
commit 17633b4e3c
7 changed files with 86 additions and 76 deletions
+2 -1
View File
@@ -217,6 +217,7 @@ func (c *Client) processEventStream(subscribe grpc.BidiStreamingClient[proto.Nod
}
switch recv.GetType() {
case proto.EventType_SLUG_CHANGE:
user := recv.GetSlugEvent().GetUser()
oldSlug := recv.GetSlugEvent().GetOld()
newSlug := recv.GetSlugEvent().GetNew()
var userSession *session.SSHSession
@@ -242,7 +243,7 @@ func (c *Client) processEventStream(subscribe grpc.BidiStreamingClient[proto.Nod
}
continue
}
err = c.sessionRegistry.Update(types.SessionKey{
err = c.sessionRegistry.Update(user, types.SessionKey{
Id: oldSlug,
Type: types.HTTP,
}, types.SessionKey{