Skip to content

Commit

Permalink
fix sequence reporting on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
basvanbeek committed Dec 24, 2021
1 parent a54ee42 commit dad159e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions group.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,17 @@ func (g *Group) Run(args ...string) (err error) {
continue
}
hasServices = true
itemNr := idx + 1
g.Logger.Debug("serve",
"name", s.Name(),
"item", fmt.Sprintf("(%d/%d)", idx+1, len(g.s)),
"item", fmt.Sprintf("(%d/%d)", itemNr, len(g.s)),
)
g.r.Add(func() error {
return s.Serve()
}, func(_ error) {
g.Logger.Debug("stop",
"name", s.Name(),
"item", fmt.Sprintf("(%d/%d)", idx+1, len(g.s)),
"item", fmt.Sprintf("(%d/%d)", itemNr, len(g.s)),
)
s.GracefulStop()
})
Expand Down

0 comments on commit dad159e

Please sign in to comment.