Skip to content

Commit

Permalink
fix:fix contract reporting bug when using TSF. (#1422)
Browse files Browse the repository at this point in the history
Co-authored-by: Haotian Zhang <[email protected]>
  • Loading branch information
fuyuwei01 and SkyeBeFreeman authored Aug 28, 2024
1 parent 95006a4 commit cc927d6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
- [feat: support otel trace](https://github.com/Tencent/spring-cloud-tencent/pull/1419)
- [feat:support TSF router.](https://github.com/Tencent/spring-cloud-tencent/pull/1420)
- [feat:upgrade nearby router and add namespace nearby router.](https://github.com/Tencent/spring-cloud-tencent/pull/1421)
- [fix:fix contract reporting bug when using TSF.](https://github.com/Tencent/spring-cloud-tencent/pull/1422)
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,11 @@ public void setExposure(boolean exposure) {

@Override
public boolean isReportEnabled() {
if (Objects.nonNull(extendContractProperties)) {
return extendContractProperties.isReportEnabled();
}
return reportEnabled;
}

@Override
public void setReportEnabled(boolean reportEnabled) {
if (Objects.nonNull(extendContractProperties)) {
extendContractProperties.setReportEnabled(reportEnabled);
}
this.reportEnabled = reportEnabled;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class TsfContractProperties implements ExtendedContractProperties {

@Override
public boolean isEnabled() {
return false;
return enabled;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp
defaultProperties.put("spring.cloud.polaris.config.enabled", "true");
}
else {
defaultProperties.put("spring.cloud.polaris.contract.report.enabled", "false");
defaultProperties.put("spring.cloud.polaris.config.enabled", "true");
defaultProperties.put("spring.cloud.polaris.config.internal-enabled", "false");
defaultProperties.put("spring.cloud.polaris.config.data-source", "consul");
Expand Down

0 comments on commit cc927d6

Please sign in to comment.