From 54aa39543bead185c62fc67eb7b621f63bd13717 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Wed, 2 Jul 2014 18:25:47 -0700 Subject: [PATCH] timeouts: Use After() instead of Tick() --- coreos-cloudinit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go index 4c4ba5d..9e2ee66 100644 --- a/coreos-cloudinit.go +++ b/coreos-cloudinit.go @@ -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)