提交 794874bf 编写于 作者: O o2null

Merge branch 'fix/cluster' into 'develop'

修复集群应用掉线判断.

See merge request o2oa/o2oa!754
......@@ -30,7 +30,7 @@ public class Application extends GsonPropertyObject {
private List<ScheduleLocalRequest> scheduleLocalRequestList = new ArrayList<>();
public Application() {
// nothing
}
public List<ScheduleRequest> getScheduleRequestList() {
......
......@@ -36,16 +36,15 @@ public class VoteCenterEvent implements Event {
|| (!Objects.equals(Config.resource_node_centersPirmaryPort(), entry.getValue().getPort()))
|| (!Objects.equals(Config.resource_node_centersPirmarySslEnable(),
entry.getValue().getSslEnable()))) {
logger.print("pirmary center set as:{}, in {}.", entry.getKey(), this.nodes(list));
logger.warn("pirmary center set as: {}, in {}.", entry.getKey(), this.nodes(list));
Config.resource_node_centersPirmaryNode(entry.getKey());
Config.resource_node_centersPirmaryPort(entry.getValue().getPort());
Config.resource_node_centersPirmarySslEnable(entry.getValue().getSslEnable());
}
return;
}
} catch (Exception e) {
logger.print("failed to connect pirmary center:{} port:{} sslEnable:{}.", entry.getKey(),
logger.warn("failed to connect center: {}, port: {}, sslEnable: {}.", entry.getKey(),
entry.getValue().getPort(), entry.getValue().getSslEnable());
}
}
......
......@@ -63,11 +63,13 @@ public class CenterQueue extends AbstractQueue<CenterQueueBody> {
for (Entry<String, CopyOnWriteArrayList<Application>> en : applications.entrySet()) {
List<Application> removeApplications = new ArrayList<>();
for (Application application : en.getValue()) {
if ((now.getTime() - application.getReportDate().getTime()) > REFRESHAPPLICATIONSINTERVAL * 3 * 1000) {
if ((now.getTime() - application.getReportDate().getTime()) > REFRESHAPPLICATIONSINTERVAL * 1000
+ 10000) {
removeApplications.add(application);
logger.warn("application dropped, node: {}, application: {}.", application.getNode(), en.getKey());
}
}
modify = modify || en.getValue().removeAll(removeApplications);
modify = en.getValue().removeAll(removeApplications) || modify;
if (en.getValue().isEmpty()) {
removeEntries.add(en.getKey());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册