some small changes
parent
fc0c5c43f1
commit
1124172331
|
@ -10,8 +10,8 @@ func Ticker(fn func(), interval time.Duration) chan struct{} {
|
||||||
}
|
}
|
||||||
ticker := time.NewTicker(interval)
|
ticker := time.NewTicker(interval)
|
||||||
stopChan := make(chan struct{})
|
stopChan := make(chan struct{})
|
||||||
fn()
|
|
||||||
go func() {
|
go func() {
|
||||||
|
fn()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
|
|
Loading…
Reference in New Issue