拉取任务拆分

version1
admin 2 years ago
parent 1c92bffe13
commit 2c50587faf

@ -24,7 +24,8 @@ public interface IdcService {
BaseResponse download(HttpServletRequest request,Map<String,Object> params);
public void asyncFetchTask();
public void asyncFetchUdiTask();
BaseResponse downlaodSuccess(HttpServletRequest request,Map<String,Object> params);
public void asyncIdcTask();

@ -130,9 +130,25 @@ public class IdcServiceImpl implements IdcService {
/*拉取前一级中继服务数据*/
@Async
@Override
public void asyncFetchUdiTask() {
fetchTask(false);
}
@Async
@Override
public void asyncFetchTask() {
fetchTask(true);
}
private void fetchTask(boolean isIdc) {
String host = getNextHost();
if(!isIdc) {
Map<String,Object> map = dbDao.get("select * from sync_data_set limit 1");
if(map!=null&&map.get("syncIp")!=null)
host = map.get("syncIp").toString();
}
logger.info("fetch from ip:"+host);
if(!StringUtils.isEmpty(host)) {
String result = post(host+"/spssync/common/list",null);
@ -151,9 +167,8 @@ public class IdcServiceImpl implements IdcService {
}
}
}
}
@Async
@Override
public void asyncIdcTask() {

@ -1,4 +1,4 @@
package com.glxp.sale.admin.idc.thread;
package com.glxp.sale.admin.thread;
import javax.annotation.Resource;
Loading…
Cancel
Save