log "loading papi client" only if papi is enabled (#2762)

This commit is contained in:
mmetc 2024-01-22 13:25:36 +01:00 committed by GitHub
parent 455acf7c90
commit dc698ecea8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -243,9 +243,9 @@ func NewServer(config *csconfig.LocalApiServerCfg) (*APIServer, error) {
controller.AlertsAddChan = apiClient.AlertsAddChan
if apiClient.apiClient.IsEnrolled() {
log.Infof("Machine is enrolled in the console, Loading PAPI Client")
if config.ConsoleConfig.IsPAPIEnabled() {
log.Info("Machine is enrolled in the console, Loading PAPI Client")
papiClient, err = NewPAPI(apiClient, dbClient, config.ConsoleConfig, *config.PapiLogLevel)
if err != nil {
return nil, err