Authored by qinchao

伸缩完善:查询伸缩组下的主机信息时,有可能网络中断造成一次错误,修改为错误发生5次才停止

... ... @@ -181,7 +181,7 @@
</div>
<script src="<%=basePath%>script/common/genarate_left_panel.js"></script>
<script src="<%=basePath%>script/autoscaling/autoscaling_new.js?v=20171024-1"></script>
<script src="<%=basePath%>script/autoscaling/autoscaling_new.js?v=20171113-1"></script>
<script>
$("#li_manager").addClass("active open");
$("#li_autoscaling").addClass("active");
... ...
... ... @@ -379,6 +379,7 @@ function refCloudMessage(cloudType,showMessage, serverChangeCount,desiredCapacit
var url = contextPath + 'autoScalingTool/getIpsByScalingGroupId?groupName='+tmpGroupName+'&groupId='+souScalingGroupId+"&cloudType="+$("#cloudType").val();
writeToText("开始..........");
var count = 0;
var errorTimes = 0;
var intervalIndex = setInterval(function() {
$.ajax({
url: url,
... ... @@ -387,10 +388,17 @@ function refCloudMessage(cloudType,showMessage, serverChangeCount,desiredCapacit
timeout : 0,
success: function (data) {
if (!data || data.code != 200) {
errorTimes++;
if(errorTimes>5){
clearInterval(intervalIndex);
writeToText("发生错误,refCloudMessage data 程序终止..........");
writeToText("发生错误data is null or data code !=200,refCloudMessage data 程序终止..........");
writeToText("data is "+data);
responseError(data);
}else{
writeToText("发生错误data is null or data code !=200,继续获取数据,请耐心等待,getIpsByScalingGroupId data errorTimes =."+errorTimes);
writeToText("data is "+data);
}
}else{
//计算变化主机的ip
var checkPassFlag=true;
var changedIps="";
... ... @@ -436,9 +444,16 @@ function refCloudMessage(cloudType,showMessage, serverChangeCount,desiredCapacit
count += 1;
},
error: function (e) {
errorTimes++;
if(errorTimes>5){
clearInterval(intervalIndex);
writeToText("发生错误,refCloudMessage 程序终止..........");
writeToText("发生错误error,refCloudMessage 程序终止..........");
writeToText("error is "+e);
requestError(url);
}else{
writeToText("发生错误error,继续获取数据,请耐心等待,getIpsByScalingGroupId data errorTimes =."+errorTimes);
writeToText("error is "+e);
}
}
});
}, 20000);
... ...