Skip to content

Commit

Permalink
chore(source): typos and wrong args number on fallback function usage (
Browse files Browse the repository at this point in the history
  • Loading branch information
helio-frota authored and lance committed Mar 28, 2018
1 parent 139437f commit 0045b37
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const MinifyPlugin = require('babel-minify-webpack-plugin');
module.exports = {
entry: {
main: [
'./index.js'
'./index.js'
]
},
mode: "production",
mode: 'production',
output: {
filename: 'opossum.js'
},
plugins: [
new MinifyPlugin()
]
}
};
10 changes: 5 additions & 5 deletions lib/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please use options.errorThresholdPercentage`;
* @extends EventEmitter
* @param action {Function} The action to fire for this {@link CircuitBreaker}
* @param options {Object} Options for the {@link CircuitBreaker}.
* There are **no default options** when you use the contructor directly. You
* There are **no default options** when you use the constructor directly. You
* must supply values for each of these.
* @param options.timeout {Number} The time in milliseconds that action should
* be allowed to execute before timing out.
Expand Down Expand Up @@ -305,7 +305,7 @@ class CircuitBreaker extends EventEmitter {
*/
this.emit('reject', new Error('Breaker is open'));

return fallback(this, 'Breaker is open', args, 0) ||
return fallback(this, 'Breaker is open', args) ||
Promise.reject(new Error('Breaker is open'));
}
this[PENDING_CLOSE] = false;
Expand Down Expand Up @@ -394,7 +394,7 @@ class CircuitBreaker extends EventEmitter {
* `options.errorThresholdPercentage` in the constructor. For example, if the
* health check function provided here always returns a resolved promise, the
* circuit can still trip and open if there are failures exceeding the
* configured threshold. The health check function is excecuted within the
* configured threshold. The health check function is executed within the
* circuit breaker's execution context, so `this` within the function is the
* circuit breaker itself.
*
Expand Down Expand Up @@ -438,7 +438,7 @@ class CircuitBreaker extends EventEmitter {

/**
* Enables this circuit. If the circuit is the disabled
* state, it will be reenabled. If not, this is essentially
* state, it will be re-enabled. If not, this is essentially
* a noop.
*/
enable () {
Expand All @@ -457,7 +457,7 @@ class CircuitBreaker extends EventEmitter {
function handleError (error, circuit, timeout, args, latency, resolve, reject) {
clearTimeout(timeout);
fail(circuit, error, args, latency);
const fb = fallback(circuit, error, args, latency);
const fb = fallback(circuit, error, args);
if (fb) resolve(fb);
else reject(error);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/hystrix-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function hystrixFormatter (stats) {
rollingCountTimeout: stats.timeouts,
currentConcurrentExecutionCount: 0,
rollingMaxConcurrentExecutionCount: 0,
// TODO: caluclate these latency values
// TODO: calculate these latency values
latencyExecute_mean: stats.latencyMean || 0,
latencyExecute: percentiles(stats),
// Whats the difference between execute and total?
Expand Down
2 changes: 1 addition & 1 deletion lib/hystrix-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hystrixStream = new Transform({
}
});

// TODO: This number is somewhat arbitrary. Howver, we need to allow
// TODO: This number is somewhat arbitrary. However, we need to allow
// a potentially large number of listeners on this transform stream
// because all circuits are connected to it. In an application with
// a large number of circuits (or tests using circuits), if left to
Expand Down
4 changes: 2 additions & 2 deletions lib/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const EventEmitter = require('events').EventEmitter;
*/
class Status extends EventEmitter {
/**
* Emitted at each timeslice. Listeners for this
* Emitted at each time-slice. Listeners for this
* event will receive a cumulative snapshot of the current status window.
* @see Status#stats
* @event Status#snapshot
Expand Down Expand Up @@ -102,7 +102,7 @@ class Status extends EventEmitter {
}, bucket());

if (this.rollingPercentilesEnabled) {
// Sort the latencyTimess
// Sort the latencyTimes
totals.latencyTimes.sort((a, b) => a - b);

// Get the mean latency
Expand Down

0 comments on commit 0045b37

Please sign in to comment.