Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
circuits: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Feb 29, 2016
1 parent aeee336 commit 0eb47c1
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions circuits.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,6 @@ Circuits.prototype.getCircuitTuples = function getCircuitTuples() {
return tuples;
};

Circuits.prototype.getCircuitForRequest = function getCircuitForRequest(req) {
// Default the caller name.
// All callers that fail to specifiy a cn share a circuit for each sn:en
// and fail together.
var callerName = req.headers.cn || 'no-cn';
var serviceName = req.serviceName;
if (!serviceName) {
return new Result(new ErrorFrame('BadRequest', 'All requests must have a service name'));
}

var arg1 = String(req.arg1);
var circuit = this.getCircuit(callerName, serviceName, arg1);

if (!circuit.state.shouldRequest()) {
return new Result(new ErrorFrame('Unhealthy', 'Service is not healthy'));
}

return new Result(null, circuit);
};

function ErrorFrame(codeName, message) {
this.codeName = codeName;
this.message = message;
Expand Down

0 comments on commit 0eb47c1

Please sign in to comment.