Browse Source

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

xyxie 4 ngày trước cách đây
mục cha
commit
f348e8cdf1
1 tập tin đã thay đổi với 16 bổ sung1 xóa
  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():