File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
spring-cloud-gray-client/src/main/java/cn/springcloud/gray Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public void shutdown() {
5555
5656 @ Override
5757 public boolean hasGray (String serviceId ) {
58- return GrayClientHolder .getGraySwitcher ().judge () && super .hasGray (serviceId );
58+ return GrayClientHolder .getGraySwitcher ().state () && super .hasGray (serviceId );
5959 }
6060
6161 public void openForWork () {
Original file line number Diff line number Diff line change 44import cn .springcloud .gray .cache .CaffeineCache ;
55import cn .springcloud .gray .client .GrayClientEnrollInitializingDestroyBean ;
66import cn .springcloud .gray .client .config .properties .*;
7- import cn .springcloud .gray .client .switcher .EnbGraySwitcher ;
7+ import cn .springcloud .gray .client .switcher .EnvGraySwitcher ;
88import cn .springcloud .gray .client .switcher .GraySwitcher ;
99import cn .springcloud .gray .communication .InformationClient ;
1010import cn .springcloud .gray .decision .GrayDecision ;
@@ -71,7 +71,7 @@ public GrayManager grayManager(
7171 @ Bean
7272 @ ConditionalOnMissingBean
7373 public GraySwitcher graySwitcher () {
74- return new EnbGraySwitcher (grayProperties );
74+ return new EnvGraySwitcher (grayProperties );
7575 }
7676
7777 @ Bean
Original file line number Diff line number Diff line change 22
33import cn .springcloud .gray .client .config .properties .GrayProperties ;
44
5- public class EnbGraySwitcher implements GraySwitcher {
5+ public class EnvGraySwitcher implements GraySwitcher {
66
77 private GrayProperties grayProperties ;
88
9- public EnbGraySwitcher (GrayProperties grayProperties ) {
9+ public EnvGraySwitcher (GrayProperties grayProperties ) {
1010 this .grayProperties = grayProperties ;
1111 }
1212
1313 @ Override
14- public boolean judge () {
14+ public boolean state () {
1515 return grayProperties .isEnabled ();
1616 }
1717}
Original file line number Diff line number Diff line change 22
33public interface GraySwitcher {
44
5- boolean judge ();
5+ boolean state ();
66
77
88 public static class DefaultGraySwitcher implements GraySwitcher {
99
1010 @ Override
11- public boolean judge () {
11+ public boolean state () {
1212 return true ;
1313 }
1414 }
You can’t perform that action at this time.
0 commit comments