forked from TrueCloudLab/frostfs-http-gw
use timer instead of ticker
This commit is contained in:
parent
468cf49126
commit
c4963f45bd
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -78,7 +78,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkConnection(ctx context.Context, p *Pool) {
|
func checkConnection(ctx context.Context, p *Pool) {
|
||||||
tick := time.NewTicker(time.Second * 15)
|
dur := time.Second * 15
|
||||||
|
tick := time.NewTimer(dur)
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
|
@ -87,6 +88,7 @@ loop:
|
||||||
break loop
|
break loop
|
||||||
case <-tick.C:
|
case <-tick.C:
|
||||||
p.reBalance(ctx)
|
p.reBalance(ctx)
|
||||||
|
tick.Reset(dur)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue