Skip to content

Commit

Permalink
lapi: log error "can't sinchronize with console" only if papi is enab…
Browse files Browse the repository at this point in the history
…led (#2896)
  • Loading branch information
mmetc authored Mar 14, 2024
1 parent 7dd86e2 commit caca403
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
}
}

Expand Down

0 comments on commit caca403

Please sign in to comment.