REM:
1. 处置任务启动线程异步模式修改为同步模式,避免多次启动同一个处置任务
2. 修正配置项中迪普设备超时时间配置
This commit is contained in:
HuangXin 2020-09-02 08:22:35 +08:00
parent aac7581c50
commit 0d01365a93
2 changed files with 12 additions and 12 deletions

View File

@ -77,15 +77,17 @@ public class DpTechImpl implements DisposeEntryManager {
ctx.put("password", dev.getPassword());
ctx.put("username", dev.getUserName());
// 配置连接访问超时时间
Client proxy = ClientProxy.getClient(this.cleanTypePort);
HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
// 请求超时
policy.setConnectionTimeout(GlobalVar.SOAP_CONNECT_TIMEOUT);
//读取超时
policy.setReceiveTimeout(GlobalVar.SOAP_RECEIVE_TIMEOUT);
conduit.setClient(policy);
if(GlobalVar.SOAP_CONNECT_TIMEOUT > 0 || GlobalVar.SOAP_RECEIVE_TIMEOUT > 0) {
// 配置连接访问超时时间
Client proxy = ClientProxy.getClient(this.cleanTypePort);
HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
HTTPClientPolicy policy = new HTTPClientPolicy();
// 请求超时
policy.setConnectionTimeout(GlobalVar.SOAP_CONNECT_TIMEOUT);
//读取超时
policy.setReceiveTimeout(GlobalVar.SOAP_RECEIVE_TIMEOUT);
conduit.setClient(policy);
}
}
/**

View File

@ -6,7 +6,6 @@ import com.dispose.common.GlobalVar;
import com.dispose.pojo.vo.common.TaskInfoDetail;
import com.dispose.service.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -23,11 +22,10 @@ import java.util.Iterator;
public class TaskManagerTask {
@Resource
private TaskService taskService;
/**
* Task runtime manager.
*/
@Async("bizExecutor")
@Scheduled(fixedDelay = 1000)
public void taskRuntimeManager() {
Iterator<TaskInfoDetail> it = taskService.getActiveTask().iterator();