Merge pull request #616 from JustinBeckwith/ld2

refactor: use individual lodash packages for health check
This commit is contained in:
Michael Lumish 2018-11-12 17:05:34 -08:00 committed by GitHub
commit 2e98a5323d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -20,13 +20,14 @@
var grpc = require('grpc');
var _ = require('lodash');
var _get = require('lodash.get');
var _clone = require('lodash.clone')
var health_messages = require('./v1/health_pb');
var health_service = require('./v1/health_grpc_pb');
function HealthImplementation(statusMap) {
this.statusMap = _.clone(statusMap);
this.statusMap = _clone(statusMap);
}
HealthImplementation.prototype.setStatus = function(service, status) {
@ -35,7 +36,7 @@ HealthImplementation.prototype.setStatus = function(service, status) {
HealthImplementation.prototype.check = function(call, callback){
var service = call.request.getService();
var status = _.get(this.statusMap, service, null);
var status = _get(this.statusMap, service, null);
if (status === null) {
// TODO(murgatroid99): Do this without an explicit reference to grpc.
callback({code:grpc.status.NOT_FOUND});

View File

@ -17,7 +17,8 @@
"dependencies": {
"google-protobuf": "^3.4.0",
"grpc": "^1.6.0",
"lodash": "^4.17.5"
"lodash.clone": "^4.5.0",
"lodash.get": "^4.4.2"
},
"files": [
"LICENSE",