Skip to content

Commit

Permalink
Remove duplicate field.
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
  • Loading branch information
tomwilkie committed Aug 23, 2018
1 parent 8d8cdd7 commit 4e46207
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
type Server struct {
cfg Config
handler *signals.Handler
httpListener net.Listener
grpcListener net.Listener
httpServer *http.Server

Expand Down Expand Up @@ -164,7 +163,6 @@ func New(cfg Config) (*Server, error) {
cfg: cfg,
httpListener: httpListener,
grpcListener: grpcListener,
httpServer: httpServer,
handler: signals.NewHandler(log),

HTTP: router,
Expand Down Expand Up @@ -194,7 +192,7 @@ func (s *Server) Run() error {
}()

go func() {
err := s.httpServer.Serve(s.httpListener)
err := s.HTTPServer.Serve(s.httpListener)
if err == http.ErrServerClosed {
err = nil
}
Expand Down Expand Up @@ -234,6 +232,6 @@ func (s *Server) Shutdown() {
ctx, cancel := context.WithTimeout(context.Background(), s.cfg.ServerGracefulShutdownTimeout)
defer cancel() // releases resources if httpServer.Shutdown completes before timeout elapses

s.httpServer.Shutdown(ctx)
s.HTTPServer.Shutdown(ctx)
s.GRPC.GracefulStop()
}

0 comments on commit 4e46207

Please sign in to comment.