MCPcopy
hub / github.com/scality/cloudserver / routeHandler

Function routeHandler

lib/utilities/healthcheckHandler.js:90–106  ·  view source on GitHub ↗
(deep, req, res, log, statsClient, cb)

Source from the content-addressed store, hash-verified

88}
89
90function routeHandler(deep, req, res, log, statsClient, cb) {
91 if (!isHealthy()) {
92 return cb(errors.InternalError, []);
93 }
94 if (req.method !== 'GET' && req.method !== 'POST') {
95 return cb(errors.BadRequest, []);
96 }
97 if (!deep) {
98 return metadata.checkHealth(log, err => {
99 if (err) {
100 return cb(errors.InternalError, []);
101 }
102 return statsClient.getStats(log, 's3', cb);
103 });
104 }
105 return clientCheck(false, log, cb);
106}
107
108function checkIP(clientIP) {
109 return ipCheck.ipMatchCidrList(

Callers 1

healthcheckHandlerFunction · 0.70

Calls 3

isHealthyFunction · 0.85
clientCheckFunction · 0.85
checkHealthMethod · 0.80

Tested by

no test coverage detected