Commit b0e75229 by huangfusuper

修改RPC的超时时间

parent f6049abd
...@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service; ...@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class RunJavaServiceImpl implements RunJavaService { public class RunJavaServiceImpl implements RunJavaService {
@TaskClient @TaskClient(timeout = 30000)
private TaskServer taskServer; private TaskServer taskServer;
@Override @Override
......
...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service; ...@@ -12,7 +12,7 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class RunScriptServiceImpl implements RunScriptService { public class RunScriptServiceImpl implements RunScriptService {
@RpcReference @RpcReference(timeout = 30000)
private ScriptExecutorService scriptExecutorService; private ScriptExecutorService scriptExecutorService;
@Override @Override
public DispatchResponseDto runScript(ScriptDto scriptDto) { public DispatchResponseDto runScript(ScriptDto scriptDto) {
......
...@@ -48,10 +48,11 @@ public class JavaTaskThreadRunHelper extends BaseThreadRunHelper { ...@@ -48,10 +48,11 @@ public class JavaTaskThreadRunHelper extends BaseThreadRunHelper {
javaTaskService.deleteJob(javaTask.getId()); javaTaskService.deleteJob(javaTask.getId());
} }
} }else{
javaTaskAndLogService.updateJavaTaskAndSaveLog(javaTask); javaTaskAndLogService.updateJavaTaskAndSaveLog(javaTask);
} }
} }
}
return JAVA_TASK_WAIT_TIME; return JAVA_TASK_WAIT_TIME;
} }
......
...@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils; ...@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import java.lang.reflect.Proxy; import java.lang.reflect.Proxy;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeUnit;
/** /**
* 插件端 客户端的数据初始化 * 插件端 客户端的数据初始化
...@@ -88,7 +89,7 @@ public class PluginClientInitialization { ...@@ -88,7 +89,7 @@ public class PluginClientInitialization {
//发送请求 //发送请求
pluginClient.send(address,pluginRpcRequestPacket); pluginClient.send(address,pluginRpcRequestPacket);
//获取结果 //获取结果
PluginRpcResponsePacket pluginRpcResponsePacket = pluginFutureResponse.get(); PluginRpcResponsePacket pluginRpcResponsePacket = pluginFutureResponse.get(timeout, TimeUnit.MILLISECONDS);
pluginRpcResponsePacket.setRunIp(address); pluginRpcResponsePacket.setRunIp(address);
return pluginRpcResponsePacket; return pluginRpcResponsePacket;
}catch (Exception e){ }catch (Exception e){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment