mirror of
https://github.com/ehang-io/nps.git
synced 2025-08-31 17:56:56 +00:00
Stop tickers to free up resources (#263)
This commit is contained in:
@@ -109,6 +109,7 @@ func StartNewServer(bridgePort int, cnf *file.Tunnel, bridgeType string) {
|
||||
|
||||
func dealClientFlow() {
|
||||
ticker := time.NewTicker(time.Minute)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
@@ -430,6 +431,7 @@ func GetDashboardData() map[string]interface{} {
|
||||
|
||||
func flowSession(m time.Duration) {
|
||||
ticker := time.NewTicker(m)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
|
Reference in New Issue
Block a user