Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
Signed-off-by: rjs211 <[email protected]>
  • Loading branch information
rjs211 committed Feb 7, 2021
1 parent 62b6d79 commit 6ea977c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cmd/collector/app/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ type Collector struct {
spanHandlers *SpanHandlers

// state, read only
hServer *http.Server
zkServer *http.Server
grpcServer *grpc.Server
TLSGRPCCloser io.Closer
TLSHTTPCloser io.Closer
hServer *http.Server
zkServer *http.Server
grpcServer *grpc.Server
tlsGRPCCertWatcherCloser io.Closer
tlsHTTPCertWatcherCloser io.Closer
}

// CollectorParams to construct a new Jaeger Collector.
Expand Down Expand Up @@ -112,8 +112,8 @@ func (c *Collector) Start(builderOpts *CollectorOptions) error {
}
c.hServer = httpServer

c.TLSGRPCCloser = &builderOpts.TLSGRPC
c.TLSHTTPCloser = &builderOpts.TLSHTTP
c.tlsGRPCCertWatcherCloser = &builderOpts.TLSGRPC
c.tlsHTTPCertWatcherCloser = &builderOpts.TLSHTTP
zkServer, err := server.StartZipkinServer(&server.ZipkinServerParams{
HostPort: builderOpts.CollectorZipkinHTTPHostPort,
Handler: c.spanHandlers.ZipkinSpansHandler,
Expand Down Expand Up @@ -168,11 +168,11 @@ func (c *Collector) Close() error {
c.logger.Error("failed to close span processor.", zap.Error(err))
}

if err := c.TLSGRPCCloser.Close(); err != nil {
if err := c.tlsGRPCCertWatcherCloser.Close(); err != nil {
c.logger.Error("failed to close gRPC TLS certificate watcher", zap.Error(err))
}

if err := c.TLSHTTPCloser.Close(); err != nil {
if err := c.tlsHTTPCertWatcherCloser.Close(); err != nil {
c.logger.Error("failed to close HTTP TLS certificate watcher", zap.Error(err))
}

Expand Down

0 comments on commit 6ea977c

Please sign in to comment.