Stop tickers to free up resources (#263)

This commit is contained in:
Callan Taylor
2019-12-02 04:29:36 +13:00
committed by ffdfgdfg
parent bdf12fe22a
commit 88dcea59ec
5 changed files with 8 additions and 1 deletions

View File

@@ -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: