소스 검색

Merge branch 'feature/eta2.5.9_api_stat' into debug

xyxie 4 일 전
부모
커밋
f348e8cdf1
1개의 변경된 파일16개의 추가작업 그리고 1개의 파일을 삭제
  1. 16 1
      services/websocket_msg.go

+ 16 - 1
services/websocket_msg.go

@@ -8,11 +8,15 @@ import (
 	"fmt"
 	"sync"
 	"time"
+	"runtime"
 
 	"context"
+	
 )
 
 func DealWebSocketMsg(adminId int) {
+
+
 	go DealEdbInspectionMessage(adminId)
 }
 
@@ -33,7 +37,18 @@ func DealEdbInspectionMessage(adminId int) {
 			cancel()
 		}
 	}()
-	
+	go func() {
+		ticker := time.NewTicker(time.Minute)
+		defer ticker.Stop()
+		for {
+			select {
+			case <-ticker.C:
+				utils.FileLog.Info("Current goroutine count: %d", runtime.NumGoroutine())
+			case <-ctx.Done():
+				return
+			}
+		}
+	}()
 	for {
 		select {
 		case <-ctx.Done():