service/*: log error only if nil

This commit is contained in:
Simone Gotti 2019-07-04 15:50:37 +02:00
parent 0ec0a37fa3
commit 929a6fb654
5 changed files with 38 additions and 19 deletions

View File

@ -255,12 +255,17 @@ func (s *Configstore) Run(ctx context.Context) error {
case <-ctx.Done():
log.Infof("configstore exiting")
httpServer.Close()
return nil
case err := <-lerrCh:
if err != nil {
log.Errorf("http server listen error: %+v", err)
return err
}
case err := <-errCh:
if err != nil {
log.Errorf("error: %+v", err)
return err
}
}
return nil
}

View File

@ -1429,9 +1429,12 @@ func (e *Executor) Run(ctx context.Context) error {
case <-ctx.Done():
log.Infof("runservice executor exiting")
httpServer.Close()
return nil
case err := <-lerrCh:
if err != nil {
log.Errorf("http server listen error: %v", err)
return err
}
}
return nil
}

View File

@ -333,9 +333,12 @@ func (g *Gateway) Run(ctx context.Context) error {
case <-ctx.Done():
log.Infof("configstore exiting")
httpServer.Close()
return nil
case err := <-lerrCh:
if err != nil {
log.Errorf("http server listen error: %v", err)
return err
}
}
return nil
}

View File

@ -175,9 +175,12 @@ func (s *Gitserver) Run(ctx context.Context) error {
case <-ctx.Done():
log.Infof("gitserver exiting")
httpServer.Close()
return nil
case err := <-lerrCh:
if err != nil {
log.Errorf("http server listen error: %v", err)
return err
}
}
return nil
}

View File

@ -258,12 +258,17 @@ func (s *Runservice) Run(ctx context.Context) error {
case <-ctx.Done():
log.Infof("runservice scheduler exiting")
httpServer.Close()
return nil
case err := <-lerrCh:
if err != nil {
log.Errorf("http server listen error: %v", err)
return err
}
case err := <-errCh:
if err != nil {
log.Errorf("error: %+v", err)
return err
}
}
return nil
}