lapi: log error "can't sinchronize with console" only if papi is enabled (#2896)
This commit is contained in:
parent
7dd86e2b95
commit
caca4032d1
|
@ -250,8 +250,8 @@ func NewServer(config *csconfig.LocalApiServerCfg) (*APIServer, error) {
|
||||||
|
|
||||||
controller.AlertsAddChan = apiClient.AlertsAddChan
|
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")
|
log.Info("Machine is enrolled in the console, Loading PAPI Client")
|
||||||
|
|
||||||
papiClient, err = NewPAPI(apiClient, dbClient, config.ConsoleConfig, *config.PapiLogLevel)
|
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
|
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")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue