浏览代码

心跳注册和结果回调,重试逻辑优化

xuxueli 8 年之前
父节点
当前提交
4e0d1be677
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java

+ 2 - 2
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java

@@ -79,7 +79,7 @@ public class XxlJobExecutor implements ApplicationContextAware {
         }
         }
 
 
         // init executor-server
         // init executor-server
-        initExecutorServer();
+        initExecutorServer(port, ip, appName, accessToken);
     }
     }
     public void destroy(){
     public void destroy(){
         // destory JobThreadRepository
         // destory JobThreadRepository
@@ -118,7 +118,7 @@ public class XxlJobExecutor implements ApplicationContextAware {
 
 
     // ---------------------------------- executor-server ------------------------------------
     // ---------------------------------- executor-server ------------------------------------
     private NetComServerFactory serverFactory = new NetComServerFactory();
     private NetComServerFactory serverFactory = new NetComServerFactory();
-    private void initExecutorServer() throws Exception {
+    private void initExecutorServer(int port, String ip, String appName, String accessToken) throws Exception {
         NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());   // rpc-service, base on jetty
         NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());   // rpc-service, base on jetty
         NetComServerFactory.setAccessToken(accessToken);
         NetComServerFactory.setAccessToken(accessToken);
         serverFactory.start(port, ip, appName); // jetty + registry
         serverFactory.start(port, ip, appName); // jetty + registry