Skip to content
This repository has been archived by the owner on Oct 2, 2022. It is now read-only.

Commit

Permalink
Fixed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Pasztor committed Feb 25, 2021
1 parent a29dc5d commit d5bd28e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
17 changes: 11 additions & 6 deletions pool_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ func (p *pool) RunWithLifecycle(lifecycle Lifecycle) error {
}
}

startedServices = p.processRunning(lifecycle, stopped, startedServices)

for i := 0; i < startedServices; i++ {
<-p.stopComplete
}
p.logger.Info(log.NewMessage(MServicesStopped, "All services have stopped."))
return p.lastError
}

func (p *pool) processRunning(lifecycle Lifecycle, stopped bool, startedServices int) int {
if !stopped {
p.logger.Info(log.NewMessage(MServicesRunning, "All services are now running."))

Expand All @@ -96,12 +106,7 @@ func (p *pool) RunWithLifecycle(lifecycle Lifecycle) error {
lifecycle.Stopping()
p.triggerStop(context.Background())
}

for i := 0; i < startedServices; i++ {
<-p.stopComplete
}
p.logger.Info(log.NewMessage(MServicesStopped, "All services have stopped."))
return p.lastError
return startedServices
}

func (p *pool) runService(service Service) {
Expand Down

0 comments on commit d5bd28e

Please sign in to comment.