Skip to content

Commit

Permalink
no need to use additional group for synchronization. (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
p0lyn0mial authored Feb 26, 2018
1 parent fd82298 commit e5070f0
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,8 @@ func startControllerViaLeaderElection(runOptions controllerRunOptions) error {
}
go le.Run()

var g run.Group
{
g.Add(func() error {
<-runOptions.parentCtx.Done()
return errors.New("closing the app because leadership position was lost")
}, func(err error) {
runOptions.parentCtxDone()
})
}
return g.Run()
<-runOptions.parentCtx.Done()
return nil
}

// createUtilHttpServer creates a new HTTP server
Expand Down

0 comments on commit e5070f0

Please sign in to comment.