1
0
Fork 0

fixed cluster parsing issue when node information is not available

This commit is contained in:
hkernbach 2017-01-10 17:07:51 +01:00
parent bcca5d8f95
commit 4ae274fbd3
1 changed files with 16 additions and 7 deletions

View File

@ -1180,23 +1180,32 @@ actions.defineHttp({
'/_api/collection/' + shard.shard + '/count', '', {}, options);
} catch (e) {
}
let leaderCount = null;
if (leaderOP) {
leaderR = ArangoClusterComm.wait(leaderOP);
leaderBody = JSON.parse(leaderR.body);
leaderCount = leaderBody.count;
}
let followerCount = null;
if (followerOP) {
followerR = ArangoClusterComm.wait(followerOP);
followerBody = JSON.parse(followerR.body);
followerCount = followerBody.count;
}
result.results[shard.collection].Plan[shard.shard].progress = {
total: leaderCount,
current: followerCount
};
if (followerR.status !== 'BACKEND_UNAVAILABLE') {
try {
followerBody = JSON.parse(followerR.body);
followerCount = followerBody.count;
result.results[shard.collection].Plan[shard.shard].progress = {
total: leaderCount,
current: followerCount
};
} catch (e) {
}
}
}
});
actions.resultOk(req, res, actions.HTTP_OK, result);