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