diff --git a/pkg/httpd/router/chat.go b/pkg/httpd/router/chat.go index e043143..610d0e8 100644 --- a/pkg/httpd/router/chat.go +++ b/pkg/httpd/router/chat.go @@ -48,7 +48,7 @@ func (s *_ChatApi) ChatHandler(ctx *gin.Context) { if err != nil { if len(currentJMSS) != 0 { for _, jmss := range currentJMSS { - jmss.Close("Websocket已关闭, 会话中断") + jmss.Close("Websocket已关闭 会话中断") } } return diff --git a/pkg/httpd/router/system_chat.go b/pkg/httpd/router/system_chat.go index aacdc56..50813dc 100644 --- a/pkg/httpd/router/system_chat.go +++ b/pkg/httpd/router/system_chat.go @@ -37,7 +37,7 @@ func (s *_SystemChatApi) ChatHandler(ctx *gin.Context) { if err != nil { if len(currentJMSS) != 0 { for _, jmss := range currentJMSS { - jmss.Close("Websocket已关闭, 会话中断") + jmss.Close("Websocket已关闭 会话中断") } } return diff --git a/pkg/jms/jms_session.go b/pkg/jms/jms_session.go index 62c2050..acf677f 100644 --- a/pkg/jms/jms_session.go +++ b/pkg/jms/jms_session.go @@ -53,7 +53,7 @@ func (jmss *JMSSession) MaximumIdleTimeDetection() { idleTime := currentTime.Sub(lastActiveTime) if idleTime.Seconds() >= float64(jmss.MaxIdleTime*60) { - reason := fmt.Sprintf("超过当前会话最大空闲时间 %d (分), 会话中断", jmss.MaxIdleTime) + reason := fmt.Sprintf("超过当前会话最大空闲时间 %d (分) 会话中断", jmss.MaxIdleTime) jmss.Close(reason) break } @@ -74,7 +74,7 @@ func (jmss *JMSSession) MaxSessionTimeDetection() { idleTime := currentTime.Sub(lastActiveTime) if idleTime.Seconds() >= float64(jmss.MaxSessionTime*60*60) { - reason := fmt.Sprintf("超过当前会话最大时间 %d (时), 会话中断", jmss.MaxSessionTime) + reason := fmt.Sprintf("超过当前会话最大时间 %d (时) 会话中断", jmss.MaxSessionTime) jmss.Close(reason) break } @@ -87,7 +87,7 @@ func (jmss *JMSSession) Close(reason string) { go jmss.SessionHandler.recordSessionLife( jmss.Session, protobuf.SessionLifecycleLogRequest_AssetConnectFinished, - "", + reason, ) time.Sleep(1 * time.Second) jmss.ReplayHandler.Upload()