|
@@ -6,6 +6,7 @@ import (
|
|
|
"eta/eta_api/services/data"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
+ "runtime"
|
|
|
"sync"
|
|
|
"time"
|
|
|
|
|
@@ -24,19 +25,19 @@ func DealEdbInspectionMessage(connKey string, conn *websocket.Conn, adminId int)
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
|
defer cancel()
|
|
|
|
|
|
- // // 监控 goroutine 数量
|
|
|
- // 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
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }()
|
|
|
+ // 监控 goroutine 数量
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }()
|
|
|
|
|
|
cacheKey := fmt.Sprintf("%s%d", utils.CACHE_EDB_INSPECTION_MESSAGE, adminId)
|
|
|
|