@Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @Lazy(false)
        public Runnable servicesManagerScheduledLoader(
            final ConfigurableApplicationContext applicationContext,
            @Qualifier("serviceRegistryExecutionPlan")
            final ServiceRegistryExecutionPlan serviceRegistryExecutionPlan,
            final CasConfigurationProperties casProperties,
            @Qualifier(ServicesManager.BEAN_NAME)
            final ServicesManager servicesManager) {

            return BeanSupplier.of(Runnable.class)
                .when(BeanCondition.on("cas.service-registry.schedule.enabled").isTrue().evenIfMissing()
                    .given(applicationContext.getEnvironment()))
                .supply(() -> {
                    val filter = (Predicate) Predicates.not(Predicates.instanceOf(ImmutableServiceRegistry.class));
                    if (!serviceRegistryExecutionPlan.find(filter).isEmpty()) {
                        LOGGER.trace("Background task to load services is enabled to run every [{}]",
                            casProperties.getServiceRegistry().getSchedule().getRepeatInterval());
                        return new ServicesManagerScheduledLoader(servicesManager);
                    }
                    LOGGER.trace("Background task to load services is disabled");
                    return ServicesManagerScheduledLoader.noOp();
                })
                .otherwiseProxy()
                .get();
        }
This is {@link CasCoreServicesConfiguration}.

@author Misagh Moayyed
@since 5.0.0
core/cas-server-core-services/src/main/java/org/apereo/cas/config/CasCoreServicesConfiguration.java