Browse Source

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

xuxueli 8 years ago
parent
commit
4e0d1be677

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

79
         }
79
         }
80
 
80
 
81
         // init executor-server
81
         // init executor-server
82
-        initExecutorServer();
82
+        initExecutorServer(port, ip, appName, accessToken);
83
     }
83
     }
84
     public void destroy(){
84
     public void destroy(){
85
         // destory JobThreadRepository
85
         // destory JobThreadRepository
118
 
118
 
119
     // ---------------------------------- executor-server ------------------------------------
119
     // ---------------------------------- executor-server ------------------------------------
120
     private NetComServerFactory serverFactory = new NetComServerFactory();
120
     private NetComServerFactory serverFactory = new NetComServerFactory();
121
-    private void initExecutorServer() throws Exception {
121
+    private void initExecutorServer(int port, String ip, String appName, String accessToken) throws Exception {
122
         NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());   // rpc-service, base on jetty
122
         NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());   // rpc-service, base on jetty
123
         NetComServerFactory.setAccessToken(accessToken);
123
         NetComServerFactory.setAccessToken(accessToken);
124
         serverFactory.start(port, ip, appName); // jetty + registry
124
         serverFactory.start(port, ip, appName); // jetty + registry