mirror of https://gitee.com/bigwinds/arangodb
ignore coordinators that have no endpoint
This commit is contained in:
parent
f2c3d2814a
commit
765af468f5
|
@ -498,13 +498,20 @@ router.get("/coordshort", function(req, res) {
|
||||||
if (Array.isArray(coordinators)) {
|
if (Array.isArray(coordinators)) {
|
||||||
var coordinatorStats = coordinators.map(coordinator => {
|
var coordinatorStats = coordinators.map(coordinator => {
|
||||||
var endpoint = global.ArangoClusterInfo.getServerEndpoint(coordinator);
|
var endpoint = global.ArangoClusterInfo.getServerEndpoint(coordinator);
|
||||||
var response = download(endpoint.replace(/^tcp/, "http") + "/_db/_system/_admin/aardvark/statistics/short?count=" + coordinators.length, '', {headers: {}});
|
if (endpoint !== "") {
|
||||||
try {
|
var response = download(endpoint.replace(/^tcp/, "http") + "/_db/_system/_admin/aardvark/statistics/short?count=" + coordinators.length, '', {headers: {}});
|
||||||
return JSON.parse(response.body);
|
if (response.body === undefined) {
|
||||||
} catch (e) {
|
console.warn("cannot contact coordinator " + coordinator + " on endpoint " + endpoint);
|
||||||
console.error("Couldn't read statistics response:", response.body);
|
} else {
|
||||||
throw e;
|
try {
|
||||||
|
return JSON.parse(response.body);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Couldn't read statistics response:", response.body);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return {};
|
||||||
});
|
});
|
||||||
|
|
||||||
mergeHistory(coordinatorStats);
|
mergeHistory(coordinatorStats);
|
||||||
|
|
Loading…
Reference in New Issue