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 {
|
||||
case <-stop:
|
||||
return
|
||||
case <-time.Tick(duration):
|
||||
case <-time.After(duration):
|
||||
duration = pkg.ExpBackoff(duration, datasourceMaxInterval)
|
||||
}
|
||||
}
|
||||
@ -262,7 +262,7 @@ func selectDatasource(sources []datasource.Datasource) datasource.Datasource {
|
||||
select {
|
||||
case s = <-ds:
|
||||
case <-done:
|
||||
case <-time.Tick(datasourceTimeout):
|
||||
case <-time.After(datasourceTimeout):
|
||||
}
|
||||
|
||||
close(stop)
|
||||
|
Loading…
Reference in New Issue
Block a user