Adjusting the BeforeStart () position (#1263)
Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
parent
80f2bfd5d0
commit
1034837f69
@ -154,6 +154,12 @@ func (s *service) start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, fn := range s.opts.BeforeStart {
|
||||
if err := fn(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.listen("tcp", s.opts.Address)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -192,12 +198,6 @@ func (s *service) start() error {
|
||||
})
|
||||
}
|
||||
|
||||
for _, fn := range s.opts.BeforeStart {
|
||||
if err := fn(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
var httpSrv *http.Server
|
||||
if s.opts.Server != nil {
|
||||
httpSrv = s.opts.Server
|
||||
|
Loading…
Reference in New Issue
Block a user