mirror of https://gitee.com/bigwinds/arangodb
Heartbeats are now interpreted the new way
This commit is contained in:
parent
59c597061c
commit
799f443b2f
|
@ -237,13 +237,13 @@
|
|||
var resList = [],
|
||||
list = servers.getList(),
|
||||
diffList = diff.DBServers(),
|
||||
noBeat = beats.noBeat(),
|
||||
didBeat = beats.didBeat(),
|
||||
serving = beats.getServing();
|
||||
|
||||
_.each(list, function(v, k) {
|
||||
v.name = k;
|
||||
resList.push(v);
|
||||
if (_.contains(noBeat, k)) {
|
||||
if (!_.contains(didBeat, k)) {
|
||||
v.status = "critical";
|
||||
return;
|
||||
}
|
||||
|
@ -264,12 +264,12 @@
|
|||
var resList = [],
|
||||
list = coords.getList(),
|
||||
diffList = diff.Coordinators(),
|
||||
noBeat = beats.noBeat();
|
||||
didBeat = beats.didBeat();
|
||||
|
||||
_.each(list, function(v, k) {
|
||||
v.name = k;
|
||||
resList.push(v);
|
||||
if (_.contains(noBeat, k)) {
|
||||
if (!_.contains(didBeat, k)) {
|
||||
v.status = "critical";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -701,6 +701,7 @@ exports.Communication = function() {
|
|||
return res.sort();
|
||||
};
|
||||
this.noBeat = function() {
|
||||
// Do not use, will only work in highly synced clocks
|
||||
var lastAccepted = new Date((new Date()).getTime() - (2 * interval));
|
||||
var res = [];
|
||||
var list = this.list();
|
||||
|
@ -711,6 +712,9 @@ exports.Communication = function() {
|
|||
});
|
||||
return res.sort();
|
||||
};
|
||||
this.didBeat = function() {
|
||||
return _.keys(this.list());
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue