Skip to content

Commit

Permalink
refactor: Use consistent type interface
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri<[email protected]>
  • Loading branch information
mahendrapaipuri committed Nov 16, 2023
1 parent d217343 commit 52bc846
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/dcgmexporter/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewMetricsServer(c *Config, metrics chan string) (*MetricsServer, func(), e
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
},
webConfig: web.FlagConfig{
webConfig: &web.FlagConfig{
WebListenAddresses: &[]string{c.Address},
WebSystemdSocket: &c.WebSystemdSocket,
WebConfigFile: &c.WebConfigFile,
Expand Down Expand Up @@ -74,7 +74,7 @@ func (s *MetricsServer) Run(stop chan interface{}, wg *sync.WaitGroup) {
go func() {
defer httpwg.Done()
logrus.Info("Starting webserver")
if err := web.ListenAndServe(s.server, &s.webConfig, logger); err != nil && err != http.ErrServerClosed {
if err := web.ListenAndServe(s.server, s.webConfig, logger); err != nil && err != http.ErrServerClosed {
logrus.Fatalf("Failed to Listen and Server HTTP server with err: `%v`", err)
}
}()
Expand Down
2 changes: 1 addition & 1 deletion pkg/dcgmexporter/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ type MetricsServer struct {
sync.Mutex

server *http.Server
webConfig web.FlagConfig
webConfig *web.FlagConfig
metrics string
metricsChan chan string
}
Expand Down

0 comments on commit 52bc846

Please sign in to comment.