Authored by qinchao

测试环境停止检测

package com.ui.cloud.task;
import com.ui.model.BaseResponse;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
... ... @@ -17,6 +19,10 @@ import org.springframework.stereotype.Component;
public class FetchAutoScalingTask {
private Logger logger = LoggerFactory.getLogger(getClass());
//当前环境
@Value("${system.envi}")
private String env;
@Autowired
private AutoScalingLoader autoScalingLoader;
... ... @@ -40,6 +46,9 @@ public class FetchAutoScalingTask {
*/
@Scheduled(cron = "15/30 * * * * ?")
public void qcloudFetchAutoScaling() {
if(StringUtils.equals("test",env)){
return ;
}
BaseResponse groups=autoScalingLoader.remoteLoadAutoScalingGroup(2);
if(groups==null){
logger.error("FetchAutoScalingTask qcloudFetchAutoScaling result is null");
... ...
system.envi=product
monitor.service.url=http://monitor-service-master:8080/monitor
job.run.log.limit=10
web.context=monitor-ui
\ No newline at end of file
... ...
system.envi=test
monitor.service.url=http://127.0.0.1:8880/monitor
zkAddress=192.168.102.45:2181
job.run.log.limit=10
... ...