From d8d323ad0eef1b8bd3eccb4a1ccb42acfa46990c Mon Sep 17 00:00:00 2001 From: fanqq Date: Tue, 30 Jun 2015 15:06:24 +0800 Subject: [PATCH] fix dyups bug --- .../zeus/service/nginx/impl/NginxServiceImpl.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/ctrip/zeus/service/nginx/impl/NginxServiceImpl.java b/src/main/java/com/ctrip/zeus/service/nginx/impl/NginxServiceImpl.java index f125e45f..06095a5d 100644 --- a/src/main/java/com/ctrip/zeus/service/nginx/impl/NginxServiceImpl.java +++ b/src/main/java/com/ctrip/zeus/service/nginx/impl/NginxServiceImpl.java @@ -208,17 +208,6 @@ public class NginxServiceImpl implements NginxService { Slb slb = slbRepository.getById(slbId); int version = nginxConfService.getCurrentVersion(slbId); boolean flag = false; - String ip = S.getIp(); - - NginxServerDo nginxServer = nginxServerDao.findByIp(ip, NginxServerEntity.READSET_FULL); - if (nginxServer != null && nginxServer.getVersion() >= version) { - NginxResponse res = new NginxResponse(); - res.setServerIp(ip).setSucceed(true).setOutMsg("current version is lower then or equal the version used!current version [" - + version + "],used version [" + nginxServer.getVersion() + "]"); - List responses = new ArrayList<>(); - responses.add(res); - return responses; - } List slbServers = slb.getSlbServers(); for (SlbServer slbServer : slbServers) { @@ -234,6 +223,8 @@ public class NginxServiceImpl implements NginxService { // update the used version in the db NginxServerDo nginxServerDo = nginxServerDao.findByIp(slbServer.getIp(), NginxServerEntity.READSET_FULL); nginxServerDao.updateByPK(nginxServerDo.setVersion(version), NginxServerEntity.UPDATESET_FULL); + }else { + throw new Exception("Dyups all failed !"); } } return result;