Skip to content

Commit

Permalink
Fix bug: Forget to Stop the ticker in keepAlive
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
  • Loading branch information
Jianhui Zhao committed Apr 16, 2019
1 parent ccaec3f commit 0720388
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func (dev *Device) keepAlive(keepalive int64) {
defer dev.Close()

ticker := time.NewTicker(time.Second * time.Duration(keepalive))
defer ticker.Stop()

last := time.Now().Unix()
keepalive = keepalive * 3

Expand Down

0 comments on commit 0720388

Please sign in to comment.