timeouts: Use After() instead of Tick()

This commit is contained in:
Alex Crawford 2014-07-02 18:25:47 -07:00
parent 8566a2c118
commit 54aa39543b

View File

@ -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)