lapi: log error "can't sinchronize with console" only if papi is enabled (#2896)

This commit is contained in:
mmetc 2024-03-14 14:03:43 +01:00 committed by GitHub
parent 7dd86e2b95
commit caca4032d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,8 +250,8 @@ func NewServer(config *csconfig.LocalApiServerCfg) (*APIServer, error) {
controller.AlertsAddChan = apiClient.AlertsAddChan
if apiClient.apiClient.IsEnrolled() {
if config.ConsoleConfig.IsPAPIEnabled() {
if config.ConsoleConfig.IsPAPIEnabled() {
if apiClient.apiClient.IsEnrolled() {
log.Info("Machine is enrolled in the console, Loading PAPI Client")
papiClient, err = NewPAPI(apiClient, dbClient, config.ConsoleConfig, *config.PapiLogLevel)
@ -260,9 +260,9 @@ func NewServer(config *csconfig.LocalApiServerCfg) (*APIServer, error) {
}
controller.DecisionDeleteChan = papiClient.Channels.DeleteDecisionChannel
} else {
log.Error("Machine is not enrolled in the console, can't synchronize with the console")
}
} else {
log.Errorf("Machine is not enrolled in the console, can't synchronize with the console")
}
}