mirror of
https://github.com/pnx/pinger.git
synced 2026-06-18 16:00:02 +02:00
main.go: stop ticker in eventLoop() before return.
This commit is contained in:
parent
aed415a531
commit
26babe4ae2
1 changed files with 1 additions and 0 deletions
1
main.go
1
main.go
|
|
@ -33,6 +33,7 @@ func eventLoop(pinger *probing.Pinger) {
|
||||||
select {
|
select {
|
||||||
// Got signal. stop pinger and exit goroutine
|
// Got signal. stop pinger and exit goroutine
|
||||||
case <-sig:
|
case <-sig:
|
||||||
|
ticker.Stop()
|
||||||
pinger.Stop()
|
pinger.Stop()
|
||||||
return
|
return
|
||||||
// Ticker ticks. print stats.
|
// Ticker ticks. print stats.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue