Skip to content

Commit

Permalink
stop the certWatcher using defer
Browse files Browse the repository at this point in the history
  • Loading branch information
ReToCode committed Aug 30, 2023
1 parent 99ae0c1 commit 218c1bf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/queue/sharedmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func Main(opts ...Option) error {
if err != nil {
logger.Fatal("failed to create certWatcher", zap.Error(err))
}
defer certWatcher.Stop()

// Drop admin http server since the admin TLS server is listening on the same port
delete(httpServers, "admin")
Expand Down Expand Up @@ -315,10 +316,6 @@ func Main(opts ...Option) error {
}
}

if certWatcher != nil {
certWatcher.Stop()
}

logger.Info("Shutdown complete, exiting...")
}
return nil
Expand Down

0 comments on commit 218c1bf

Please sign in to comment.