Skip to content

Commit

Permalink
Fix close order and build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
anuptalwalkar committed Apr 24, 2017
1 parent a57e7cd commit 3da9558
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions service2/service2.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"go.uber.org/dig"
"go.uber.org/fx/config"
"go.uber.org/zap"
)

// Service foo
Expand All @@ -52,8 +53,10 @@ func (s *Service) Start() {
func (s *Service) Stop() {
// close all dig stuff
log.Println("Stopping...")
for _, closer := range _closers {
closer.Close()
for i := len(_closers) - 1; i >= 0; i-- {
if err := _closers[i].Close(); err != nil {
zap.L().Error("Failure to close", zap.Error(err))
}
}
}

Expand Down

0 comments on commit 3da9558

Please sign in to comment.