Fix #20010 - Don't initialize pipeline service client if not enabled (#20013)

* do not init service client if disabled

* format
This commit is contained in:
Pere Miquel Brull 2025-03-07 14:31:01 +01:00 committed by GitHub
parent 6a60d4cb68
commit 6b45d84f6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View File

@ -35,6 +35,11 @@ public final class PipelineServiceClientFactory {
return pipelineServiceClient;
}
if (Boolean.FALSE.equals(config.getEnabled())) {
LOG.debug("Pipeline Service Client is disabled. Skipping initialization.");
return null;
}
String pipelineServiceClientClass = config.getClassName();
LOG.debug("Registering PipelineServiceClient: {}", pipelineServiceClientClass);

View File

@ -26,7 +26,7 @@ public class ServicesStatusJobHandler {
public static final String PIPELINE_SERVICE_STATUS_JOB = "pipelineServiceStatusJob";
public static final String STATUS_GROUP = "status";
public static final String PIPELINE_STATUS_CRON_TRIGGER = "pipelineStatusTrigger";
public static final String DATABSE_SEARCH_STATUS_CRON_TRIGGER = "databaseAndSearchStatusTrigger";
public static final String DATABASE_SEARCH_STATUS_CRON_TRIGGER = "databaseAndSearchStatusTrigger";
public static final String JOB_CONTEXT_PIPELINE_SERVICE_CLIENT = "pipelineServiceClient";
public static final String JOB_CONTEXT_METER_REGISTRY = "meterRegistry";
public static final String JOB_CONTEXT_CLUSTER_NAME = "clusterName";
@ -112,7 +112,8 @@ public class ServicesStatusJobHandler {
jobBuilder(
DatabseAndSearchServiceStatusJob.class, DATABASE_SEARCH_STATUS_JOB, STATUS_GROUP);
Trigger trigger =
getTrigger(servicesHealthCheckInterval, DATABSE_SEARCH_STATUS_CRON_TRIGGER, STATUS_GROUP);
getTrigger(
servicesHealthCheckInterval, DATABASE_SEARCH_STATUS_CRON_TRIGGER, STATUS_GROUP);
scheduler.scheduleJob(jobDetail, trigger);
} catch (Exception ex) {
LOG.error("Failed in setting up job Scheduler for Pipeline Service Status", ex);

View File

@ -102,7 +102,6 @@ public class AppResource extends EntityResource<App, AppRepository> {
private SearchRepository searchRepository;
public static final List<ScheduleType> SCHEDULED_TYPES =
List.of(ScheduleType.Scheduled, ScheduleType.ScheduledOrManual, ScheduleType.NoSchedule);
public static final String SLACK_APPLICATION = "SlackApplication";
private final AppMapper mapper = new AppMapper();
@Override