Skip to content

Commit

Permalink
avoid deadlock when deleting decisions if PAPI is half configured (#3283
Browse files Browse the repository at this point in the history
)
  • Loading branch information
blotus authored Oct 16, 2024
1 parent 9976616 commit b2ac65b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func NewServer(ctx context.Context, config *csconfig.LocalApiServerCfg) (*APISer

controller.AlertsAddChan = apiClient.AlertsAddChan

if config.ConsoleConfig.IsPAPIEnabled() {
if config.ConsoleConfig.IsPAPIEnabled() && config.OnlineClient.Credentials.PapiURL != "" {
if apiClient.apiClient.IsEnrolled() {
log.Info("Machine is enrolled in the console, Loading PAPI Client")

Expand Down Expand Up @@ -340,7 +340,7 @@ func (s *APIServer) initAPIC(ctx context.Context) {

// csConfig.API.Server.ConsoleConfig.ShareCustomScenarios
if s.apic.apiClient.IsEnrolled() {
if s.consoleConfig.IsPAPIEnabled() {
if s.consoleConfig.IsPAPIEnabled() && s.papi != nil {
if s.papi.URL != "" {
log.Info("Starting PAPI decision receiver")
s.papi.pullTomb.Go(func() error { return s.papiPull(ctx) })
Expand Down

0 comments on commit b2ac65b

Please sign in to comment.