|
|
@@ -47,6 +47,8 @@ public class ExecutorRegistryThread extends Thread {
|
|
47
|
47
|
registryThread = new Thread(new Runnable() {
|
|
48
|
48
|
@Override
|
|
49
|
49
|
public void run() {
|
|
|
50
|
+
|
|
|
51
|
+ // registry
|
|
50
|
52
|
while (!toStop) {
|
|
51
|
53
|
try {
|
|
52
|
54
|
RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), appName, executorAddress);
|
|
|
@@ -77,7 +79,26 @@ public class ExecutorRegistryThread extends Thread {
|
|
77
|
79
|
}
|
|
78
|
80
|
|
|
79
|
81
|
// registry remove
|
|
|
82
|
+ try {
|
|
|
83
|
+ RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), appName, executorAddress);
|
|
|
84
|
+ for (AdminBiz adminBiz: XxlJobExecutor.getAdminBizList()) {
|
|
|
85
|
+ try {
|
|
|
86
|
+ ReturnT<String> registryResult = adminBiz.registryRemove(registryParam);
|
|
|
87
|
+ if (registryResult!=null && ReturnT.SUCCESS_CODE == registryResult.getCode()) {
|
|
|
88
|
+ registryResult = ReturnT.SUCCESS;
|
|
|
89
|
+ logger.info(">>>>>>>>>>> xxl-job registry-remove success, registryParam:{}, registryResult:{}", new Object[]{registryParam, registryResult});
|
|
|
90
|
+ break;
|
|
|
91
|
+ } else {
|
|
|
92
|
+ logger.info(">>>>>>>>>>> xxl-job registry-remove fail, registryParam:{}, registryResult:{}", new Object[]{registryParam, registryResult});
|
|
|
93
|
+ }
|
|
|
94
|
+ } catch (Exception e) {
|
|
|
95
|
+ logger.info(">>>>>>>>>>> xxl-job registry-remove error, registryParam:{}", registryParam, e);
|
|
|
96
|
+ }
|
|
80
|
97
|
|
|
|
98
|
+ }
|
|
|
99
|
+ } catch (Exception e) {
|
|
|
100
|
+ logger.error(e.getMessage(), e);
|
|
|
101
|
+ }
|
|
81
|
102
|
|
|
82
|
103
|
}
|
|
83
|
104
|
});
|