timeouts: Use After() instead of Tick()
This commit is contained in:
parent
8566a2c118
commit
54aa39543b
@ -245,7 +245,7 @@ func selectDatasource(sources []datasource.Datasource) datasource.Datasource {
|
|||||||
select {
|
select {
|
||||||
case <-stop:
|
case <-stop:
|
||||||
return
|
return
|
||||||
case <-time.Tick(duration):
|
case <-time.After(duration):
|
||||||
duration = pkg.ExpBackoff(duration, datasourceMaxInterval)
|
duration = pkg.ExpBackoff(duration, datasourceMaxInterval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ func selectDatasource(sources []datasource.Datasource) datasource.Datasource {
|
|||||||
select {
|
select {
|
||||||
case s = <-ds:
|
case s = <-ds:
|
||||||
case <-done:
|
case <-done:
|
||||||
case <-time.Tick(datasourceTimeout):
|
case <-time.After(datasourceTimeout):
|
||||||
}
|
}
|
||||||
|
|
||||||
close(stop)
|
close(stop)
|
||||||
|
Loading…
Reference in New Issue
Block a user