You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
499 B
21 lines
499 B
'use strict';
|
|
|
|
var fs = require('fs');
|
|
|
|
function HealthCheck (disableFile) {
|
|
this.disableFile = disableFile;
|
|
}
|
|
|
|
module.exports = HealthCheck;
|
|
|
|
HealthCheck.prototype.check = function (callback) {
|
|
fs.readFile(this.disableFile, function handleDisabledFile (err, data) {
|
|
var disabledError = null;
|
|
if (!err) {
|
|
disabledError = new Error(data || 'Unknown error');
|
|
disabledError.http_status = 503;
|
|
}
|
|
return callback(disabledError);
|
|
});
|
|
};
|