Disable per-user healthchecks

This commit is contained in:
Luis Bosque 2015-04-06 20:15:26 +02:00
parent 400e51f13a
commit da70839f78
2 changed files with 1 additions and 69 deletions

View File

@ -56,50 +56,7 @@ HealthCheck.prototype.check = function(config, callback) {
throw err;
}
},
function getDBParams(err) {
if (err) {
throw err;
}
startTime = Date.now();
self.metadataBackend.getAllUserDBParams(config.username, this);
},
function loadMapnik(err, dbParams) {
if (err) {
throw err;
}
result.redis = {
ok: !err,
elapsed: Date.now() - startTime,
size: Object.keys(dbParams).length
};
mapnikOptions.xml = xmlTemplate(mapnikXmlParams);
startTime = Date.now();
self.tilelive.load(mapnikOptions, this);
},
function getTile(err, source) {
if (err) {
throw err;
}
result.mapnik = {
ok: !err,
elapsed: Date.now() - startTime
};
startTime = Date.now();
source.getTile(config.z, config.x, config.y, this);
},
function handleTile(err, tile) {
result.tile = {
ok: !err
};
if (tile) {
result.tile.elapsed = Date.now() - startTime;
result.tile.size = tile.length;
}
function handleResult(err) {
callback(err, result);
}
);

View File

@ -51,31 +51,6 @@ suite('health checks', function () {
);
});
test('fails for invalid user because it is not in redis', function (done) {
resetHealthConfig();
global.environment.health.username = 'invalid';
assert.response(server,
healthCheckRequest,
{
status: 503
},
function (res, err) {
assert.ok(!err);
var parsed = JSON.parse(res.body);
assert.equal(parsed.enabled, true);
assert.equal(parsed.ok, false);
assert.equal(parsed.result.redis.ok, false);
done();
}
);
});
test('error if disabled file exists', function(done) {
var fs = require('fs');