|
|
@ -84,6 +84,12 @@ public class XxlJobExecutor {
|
|
|
|
initRpcProvider(ip, port, appName, accessToken);
|
|
|
|
initRpcProvider(ip, port, appName, accessToken);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public void destroy(){
|
|
|
|
public void destroy(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<JobThread> runningThreads = new ArrayList<>(jobThreadRepository.values());
|
|
|
|
|
|
|
|
if (logger.isInfoEnabled()) {
|
|
|
|
|
|
|
|
logger.info("running threads {}", runningThreads);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// destory executor-server
|
|
|
|
// destory executor-server
|
|
|
|
stopRpcProvider();
|
|
|
|
stopRpcProvider();
|
|
|
|
|
|
|
|
|
|
|
@ -96,6 +102,15 @@ public class XxlJobExecutor {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
jobHandlerRepository.clear();
|
|
|
|
jobHandlerRepository.clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (JobThread runningThread : runningThreads) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// wait for all job thread push result to callback queue
|
|
|
|
|
|
|
|
runningThread.join();
|
|
|
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
|
|
|
logger.warn("interrupted while stopping {}", runningThread);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// destory JobLogFileCleanThread
|
|
|
|
// destory JobLogFileCleanThread
|
|
|
|
JobLogFileCleanThread.getInstance().toStop();
|
|
|
|
JobLogFileCleanThread.getInstance().toStop();
|
|
|
|