Skip to content

Commit

Permalink
fix:fix contract reporting bug when using TSF. (#1373)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman authored Aug 12, 2024
1 parent e3333c8 commit 905a5f3
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 @@ -29,3 +29,4 @@
- [feat: support otel trace](https://github.com/Tencent/spring-cloud-tencent/pull/1363)
- [feat:support TSF router.](https://github.com/Tencent/spring-cloud-tencent/pull/1368)
- [feat:upgrade nearby router and add namespace nearby router.](https://github.com/Tencent/spring-cloud-tencent/pull/1371)
- [fix:fix contract reporting bug when using TSF.](https://github.com/Tencent/spring-cloud-tencent/pull/1373)
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 905a5f3

Please sign in to comment.