Skip to content

Commit

Permalink
Use time.After()
Browse files Browse the repository at this point in the history
  • Loading branch information
chyeh committed Jan 20, 2017
1 parent 86355be commit 2357228
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func checkReq(name string) error {
}

func isStarted(name string) bool {
timer := time.NewTimer(time.Second)
ticker := time.NewTicker(time.Millisecond * 100)

for {
Expand All @@ -67,7 +66,7 @@ func isStarted(name string) bool {
if g.IsRunning(name) {
return true
}
case <-timer.C:
case <-time.After(time.Second):
return false
}
}
Expand Down

0 comments on commit 2357228

Please sign in to comment.