Skip to content

Commit

Permalink
fix timeout not work of isStarted in cmd/start.go (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
DukeAnn authored Jul 2, 2020
1 parent b62c1bb commit 3e6771b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ func checkStartReq(name string) error {
func isStarted(name string) bool {
ticker := time.NewTicker(time.Millisecond * 100)
defer ticker.Stop()
timeout := time.After(time.Second)
for {
select {
case <-ticker.C:
if g.IsRunning(name) {
return true
}
case <-time.After(time.Second):
case <-timeout:
return false
}
}
Expand Down

0 comments on commit 3e6771b

Please sign in to comment.