Skip to content

Commit ba22ad7

Browse files
committed
fixed 添加灰度实例,没有创建灰度服务的bug
1 parent ee39321 commit ba22ad7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spring-cloud-gray-server/src/main/java/cn/springcloud/gray/server/module/jpa/JPAGrayServerModule.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ public void updateGrayStatus(String instanceId, GrayStatus grayStatus) {
8989

9090
@Override
9191
public void saveGrayInstance(GrayInstance instance) {
92+
GrayService grayService = grayServiceService.findOneModel(instance.getServiceId());
93+
if (grayService == null) {
94+
grayService = GrayService.builder().build();
95+
grayService.setServiceId(instance.getServiceId());
96+
grayServiceService.saveModel(grayService);
97+
}
9298
grayInstanceService.saveModel(instance);
9399
}
94100

0 commit comments

Comments
 (0)