Merge pull request #235 from shuLhan/dev-shulhan
Fix warnings from linter output
This commit is contained in:
commit
dca078f30b
10
service.go
10
service.go
@ -67,7 +67,7 @@ func (s *service) Init(opts ...Option) {
|
|||||||
|
|
||||||
s.once.Do(func() {
|
s.once.Do(func() {
|
||||||
// Initialise the command flags, overriding new service
|
// Initialise the command flags, overriding new service
|
||||||
s.opts.Cmd.Init(
|
_ = s.opts.Cmd.Init(
|
||||||
cmd.Broker(&s.opts.Broker),
|
cmd.Broker(&s.opts.Broker),
|
||||||
cmd.Registry(&s.opts.Registry),
|
cmd.Registry(&s.opts.Registry),
|
||||||
cmd.Transport(&s.opts.Transport),
|
cmd.Transport(&s.opts.Transport),
|
||||||
@ -153,7 +153,7 @@ func (s *service) Run() error {
|
|||||||
go s.run(ex)
|
go s.run(ex)
|
||||||
|
|
||||||
ch := make(chan os.Signal, 1)
|
ch := make(chan os.Signal, 1)
|
||||||
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL)
|
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
// wait on kill signal
|
// wait on kill signal
|
||||||
@ -165,9 +165,5 @@ func (s *service) Run() error {
|
|||||||
// exit reg loop
|
// exit reg loop
|
||||||
close(ex)
|
close(ex)
|
||||||
|
|
||||||
if err := s.Stop(); err != nil {
|
return s.Stop()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,16 @@ func TestService(t *testing.T) {
|
|||||||
// we can't test service.Init as it parses the command line
|
// we can't test service.Init as it parses the command line
|
||||||
// service.Init()
|
// service.Init()
|
||||||
|
|
||||||
// register handler
|
t.Run("Run", func(t *testing.T) {
|
||||||
// do that later
|
t.Parallel()
|
||||||
|
|
||||||
|
// run service
|
||||||
|
service.Run()
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("Debug.Health", func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
go func() {
|
|
||||||
// wait for start
|
// wait for start
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
@ -57,8 +63,5 @@ func TestService(t *testing.T) {
|
|||||||
|
|
||||||
// shutdown the service
|
// shutdown the service
|
||||||
cancel()
|
cancel()
|
||||||
}()
|
})
|
||||||
|
|
||||||
// run service
|
|
||||||
service.Run()
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user