Skip to content

Commit

Permalink
perf: remove session success update api
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Oct 23, 2024
1 parent 84a5e30 commit 0f154bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion pkg/session/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ func (s *Server) Create(ctx *gin.Context, opts ...TunnelOption) (sess TunnelSess
}
sess.ModelSession = &jmsSession
sess.ConnectedCallback = s.RegisterConnectedCallback(jmsSession)
sess.ConnectedSuccessCallback = s.RegisterConnectedSuccessCallback(jmsSession)
sess.ConnectedFailedCallback = s.RegisterConnectedFailedCallback(jmsSession)
sess.DisConnectedCallback = s.RegisterDisConnectedCallback(jmsSession)
sess.ReleaseAppletAccount = func() error {
Expand Down
7 changes: 3 additions & 4 deletions pkg/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ type TunnelSession struct {

VirtualAppOpts *model.VirtualAppContainer `json:"-"`

ConnectedCallback func() error `json:"-"`
ConnectedSuccessCallback func() error `json:"-"`
ConnectedFailedCallback func(err error) error `json:"-"`
DisConnectedCallback func() error `json:"-"`
ConnectedCallback func() error `json:"-"`
ConnectedFailedCallback func(err error) error `json:"-"`
DisConnectedCallback func() error `json:"-"`

ReleaseAppletAccount func() error `json:"-"`

Expand Down
4 changes: 1 addition & 3 deletions pkg/tunnel/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ func (g *GuacamoleTunnelServer) Connect(ctx *gin.Context) {
}
defer tunnel.Close()
g.RecordLifecycleLog(sessionId, model.AssetConnectSuccess, model.EmptyLifecycleLog)
if err1 := tunnelSession.ConnectedSuccessCallback(); err1 != nil {
logger.Errorf("Update session connect status failed %+v", err1)
}

logger.Infof("Session[%s] use resolution (%d*%d)",
sessionId, info.OptimalScreenWidth, info.OptimalScreenHeight)
meta := MetaShareUserMessage{
Expand Down

0 comments on commit 0f154bd

Please sign in to comment.