3.修正执⾏器注册 ,dashboard能够看到其注册信息JobRegistryMonitorHelper
public void start() {
registryThread = new Thread(new Runnable() {
@Override
public void run() {
while (!toStop) {
try {
// auto registry group
List<XxlJobGroup> groupList = AdminConfig().getXxlJobGroupDao().findByAddressType(0);
// if (groupList!=null && !groupList.isEmpty()) {
// remove dead address (admin/executor)
// fresh online address (admin/executor)
Map<String, List<String>> appAddressMap = new ConcurrentHashMap<String, List<String>>();
appAddressMap = XxlJobScheduler.jobGroupCache;
List<XxlJobRegistry> list = AdminConfig().getXxlJobRegistryDao().findAll(RegistryConfig.DEAD_TIMEOUT); if (list != null) {
for (XxlJobRegistry item : list) {
if (RegistryConfig.RegistType.EXECUTOR.name().RegistryGroup())) {
String appName = RegistryKey();
List<String> registryList = (appName);
if (registryList == null) {
registryList = new ArrayList<String>();
}
if (!RegistryValue())) {
registryList.RegistryValue());
}
appAddressMap.put(appName, registryList);
}
}
}
// fresh group address
for (Map.Entry<String, List<String>> entry : Set()) {
for (XxlJobGroup group : groupList) {
if (Key().AppName())) {
List<String> registryList = (AppName());
String addressListStr = null;
if (registryList != null && !registryList.isEmpty()) {
Collections.sort(registryList);
addressListStr = (",").join(registryList);
}
group.setAddressList(addressListStr);
} else {
if ("xxl-job-executor-sample".AppName())) {thread技术
continue;
}
}
}
String appName = Key();
String addressListStr = (",").Value());
XxlJobGroup group = new XxlJobGroup();
group.setAppName(appName);
group.setAddressType(0);
group.setAddressList(addressListStr);
group.setTitle("⾃动注⼊的执⾏器");
int order = AdminConfig().getXxlJobGroupDao().findMaxOrder();
group.setOrder(order + 1);
List<XxlJobGroup> oldjobGroup = AdminConfig().getXxlJobGroupDao().findByAppName(group);
if (oldjobGroup == null || oldjobGroup.isEmpty()) {
}
}
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论