Kaynağa Gözat

移除日志

wangshan 3 ay önce
ebeveyn
işleme
414e661a14
2 değiştirilmiş dosya ile 3 ekleme ve 4 silme
  1. 1 2
      services/sse/sse.go
  2. 2 2
      util/sse.go

+ 1 - 2
services/sse/sse.go

@@ -32,9 +32,8 @@ func (s *ServerSentRouter) Notify() {
 	logger.Info("message  userId:", userId)
 	if userId == "" {
 		userId = common.InterfaceToStr(s.Session().Id())
+		logger.Info("params  userId:", userId)
 	}
-	//userId = s.GetString("userId")
-	logger.Info(userId, "params  userId:", s.GetString("userId"))
 	if userId != "" {
 		// 创建用户专属的消息通道
 		messageChan := make(chan string)

+ 2 - 2
util/sse.go

@@ -42,7 +42,7 @@ var (
 
 // 向指定用户发送通知
 func SendNotification(userId string, msg model.SseMessage) {
-	logger.Info("SendNotification-----SseClients:", SseClients)
+	//logger.Info("SendNotification-----SseClients:", SseClients)
 	SseClientsMu.Lock()
 	defer SseClientsMu.Unlock()
 	msgData, _ := json.Marshal(msg)
@@ -53,7 +53,7 @@ func SendNotification(userId string, msg model.SseMessage) {
 
 // 向所有用户发送通知
 func SendNotificationToAll(msg model.SseMessage) {
-	logger.Info("SendNotificationToAll ----- SseClients:", SseClients)
+	//logger.Info("SendNotificationToAll ----- SseClients:", SseClients)
 	SseClientsMu.Lock()
 	defer SseClientsMu.Unlock()
 	msgData, _ := json.Marshal(msg)