fix:fix cb rule no update bug. (#1786)

Signed-off-by: Haotian Zhang <928016560@qq.com>
Co-authored-by: shedfreewu <49236872+shedfreewu@users.noreply.github.com>
2024
Haotian Zhang 1 week ago committed by Haotian Zhang
parent 6b2e522ba5
commit 21fe3218cf

@ -15,3 +15,4 @@
- [fix: fix parsing ConfigurationProperties value with RefreshScope.](https://github.com/Tencent/spring-cloud-tencent/pull/1780)
- [refactor: optimize performance.](https://github.com/Tencent/spring-cloud-tencent/pull/1782)
- [fix: fix NacosDiscoveryRegistryAutoConfiguration and PolarisAuthAutoConfiguration still initiation when polaris disabled.](https://github.com/Tencent/spring-cloud-tencent/pull/1783)
- [fix: fix cb rule no update bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1786)

@ -64,9 +64,9 @@ public class ConfigurationModifier implements PolarisConfigurationConfigModifier
@Override
public void modify(ConfigurationImpl configuration) {
configuration.getGlobal().getAPI().setReportEnable(false);
configuration.getGlobal().getStatReporter().setEnable(false);
configuration.getConsumer().getOutlierDetection().setWhen(OutlierDetectionConfig.When.never);
configuration.getConsumer().getCircuitBreaker().setEnable(false);
if (!polarisContextProperties.getEnabled() || !polarisConfigProperties.isEnabled()) {
return;

@ -297,9 +297,11 @@ public class PolarisConfigDataLocationResolver implements
if (!bootstrapContext.isRegistered(SDKContext.class)) {
SDKContext sdkContext = sdkContext(resolverContext,
polarisConfigProperties, polarisCryptoConfigProperties, polarisContextProperties);
// not init reporter when creating config data temp SDK context.
if (sdkContext.getConfig() instanceof ConfigurationImpl) {
// not init reporter when creating config data temp SDK context.
((ConfigurationImpl) sdkContext.getConfig()).getGlobal().getStatReporter().setEnable(false);
// not init circuit breaker when creating config data temp SDK context.
((ConfigurationImpl) sdkContext.getConfig()).getConsumer().getCircuitBreaker().setEnable(false);
}
sdkContext.init();
PolarisConfigSDKContextManager.setConfigSDKContext(sdkContext);

Loading…
Cancel
Save