Compare commits

...

2 Commits

Author SHA1 Message Date
Anurag Mittal d1e05eb580
exp/exposeCountItems 2020-01-10 19:23:44 +01:00
Anurag Mittal 8ac0beb65b
added countItems to deep healtch for easy access for UI(hack) 2020-01-10 14:22:35 +01:00
1 changed files with 6 additions and 1 deletions

View File

@ -70,6 +70,9 @@ function clientCheck(flightCheckOnStartUp, log, cb) {
if (fail) { if (fail) {
return cb(errors.InternalError, obj); return cb(errors.InternalError, obj);
} }
metadata.countItems(log, (err, res) => {
obj.dataManaged = res;
});
return cb(null, obj); return cb(null, obj);
}); });
} }
@ -110,6 +113,8 @@ function checkIP(clientIP) {
*/ */
function healthcheckHandler(clientIP, req, res, log, statsClient) { function healthcheckHandler(clientIP, req, res, log, statsClient) {
function healthcheckEndHandler(err, results) { function healthcheckEndHandler(err, results) {
console.log('##################');
console.log('In end handler, results: ', results);
writeResponse(res, err, log, results, error => { writeResponse(res, err, log, results, error => {
if (error) { if (error) {
return log.end().warn('healthcheck error', { err: error }); return log.end().warn('healthcheck error', { err: error });
@ -123,7 +128,7 @@ function healthcheckHandler(clientIP, req, res, log, statsClient) {
} }
const deep = (req.url === '/_/healthcheck/deep'); const deep = (req.url === '/_/healthcheck/deep');
return routeHandler(deep, req, res, log, statsClient, return routeHandler(deep, req, res, log, statsClient,
healthcheckEndHandler); healthcheckEndHandler);
} }
module.exports = { module.exports = {