|
|
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");
|
...
|
...
|
|