|
@@ -8,11 +8,15 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"sync"
|
|
"sync"
|
|
"time"
|
|
"time"
|
|
|
|
+ "runtime"
|
|
|
|
|
|
"context"
|
|
"context"
|
|
|
|
+
|
|
)
|
|
)
|
|
|
|
|
|
func DealWebSocketMsg(adminId int) {
|
|
func DealWebSocketMsg(adminId int) {
|
|
|
|
+
|
|
|
|
+
|
|
go DealEdbInspectionMessage(adminId)
|
|
go DealEdbInspectionMessage(adminId)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -33,7 +37,18 @@ func DealEdbInspectionMessage(adminId int) {
|
|
cancel()
|
|
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 {
|
|
for {
|
|
select {
|
|
select {
|
|
case <-ctx.Done():
|
|
case <-ctx.Done():
|