You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
doc: fix typos
This commit is contained in:
8
index.js
8
index.js
@@ -142,7 +142,7 @@ function createParser (self) {
|
||||
err.message += '. Please report this.';
|
||||
self.ready = false;
|
||||
self.flushAndError({
|
||||
message: 'Fatal error encountert. Command aborted.',
|
||||
message: 'Fatal error encountered. Command aborted.',
|
||||
code: 'NR_FATAL'
|
||||
}, {
|
||||
error: err,
|
||||
@@ -220,7 +220,7 @@ RedisClient.prototype.createStream = function () {
|
||||
|
||||
/* istanbul ignore next: difficult to test and not important as long as we keep this listener */
|
||||
this.stream.on('clientError', function (err) {
|
||||
debug('clientError occured');
|
||||
debug('clientError occurred');
|
||||
self.onError(err);
|
||||
});
|
||||
|
||||
@@ -327,7 +327,7 @@ RedisClient.prototype.onError = function (err) {
|
||||
this.connected = false;
|
||||
this.ready = false;
|
||||
|
||||
// Only emit the error if the retryStategy option is not set
|
||||
// Only emit the error if the retryStrategy option is not set
|
||||
if (!this.options.retryStrategy) {
|
||||
this.emit('error', err);
|
||||
}
|
||||
@@ -724,7 +724,7 @@ function handleOfflineCommand (self, commandObj) {
|
||||
self.shouldBuffer = true;
|
||||
}
|
||||
|
||||
// Do not call internalSendCommand directly, if you are not absolutly certain it handles everything properly
|
||||
// Do not call internalSendCommand directly, if you are not absolutely certain it handles everything properly
|
||||
// e.g. monitor / info does not work with internalSendCommand only
|
||||
RedisClient.prototype.internalSendCommand = function (commandObj) {
|
||||
var arg, prefixKeys;
|
||||
|
@@ -17,7 +17,7 @@ var changeFunctionName = (function () {
|
||||
}
|
||||
}());
|
||||
|
||||
// TODO: Rewrite this including the invidual commands into a Commands class
|
||||
// TODO: Rewrite this including the individual commands into a Commands class
|
||||
// that provided a functionality to add new commands to the client
|
||||
|
||||
commands.list.forEach(function (command) {
|
||||
|
@@ -32,9 +32,9 @@ RedisClient.prototype.sendCommand = function (command, args, callback) {
|
||||
|
||||
// Using the raw multi command is only possible with this function
|
||||
// If the command is not yet added to the client, the internal function should be called right away
|
||||
// Otherwise we need to redirect the calls to make sure the interal functions don't get skipped
|
||||
// Otherwise we need to redirect the calls to make sure the internal functions don't get skipped
|
||||
// The internal functions could actually be used for any non hooked function
|
||||
// but this might change from time to time and at the moment there's no good way to distinguishe them
|
||||
// but this might change from time to time and at the moment there's no good way to distinguish them
|
||||
// from each other, so let's just do it do it this way for the time being
|
||||
if (command === 'multi' || typeof this[command] !== 'function') {
|
||||
return this.internalSendCommand(new Command(command, args, callback));
|
||||
@@ -55,7 +55,7 @@ RedisClient.prototype.end = function (flush) {
|
||||
} else if (arguments.length === 0) {
|
||||
this.warn(
|
||||
'Using .end() without the flush parameter is deprecated and throws from v.3.0.0 on.\n' +
|
||||
'Please check the doku (https://github.com/NodeRedis/nodeRedis) and explictly use flush.'
|
||||
'Please check the documentation (https://github.com/NodeRedis/nodeRedis) and explicitly use flush.'
|
||||
);
|
||||
}
|
||||
// Clear retryTimer
|
||||
|
@@ -12,12 +12,12 @@ var RedisClient = require('../').RedisClient;
|
||||
Replace built-in redis functions
|
||||
|
||||
The callback may be hooked as needed. The same does not apply to the rest of the function.
|
||||
State should not be set outside of the callback if not absolutly necessary.
|
||||
State should not be set outside of the callback if not absolutely necessary.
|
||||
This is important to make sure it works the same as single command or in a multi context.
|
||||
To make sure everything works with the offline queue use the "callOnWrite" function.
|
||||
This is going to be executed while writing to the stream.
|
||||
|
||||
TODO: Implement individal command generation as soon as possible to prevent divergent code
|
||||
TODO: Implement individual command generation as soon as possible to prevent divergent code
|
||||
on single and multi calls!
|
||||
********************************************************************************************/
|
||||
|
||||
@@ -82,7 +82,7 @@ Multi.prototype.monitor = Multi.prototype.MONITOR = function monitor (callback)
|
||||
function quitCallback (self, callback) {
|
||||
return function (err, res) {
|
||||
if (err && err.code === 'NR_CLOSED') {
|
||||
// Pretent the quit command worked properly in this case.
|
||||
// Pretend the quit command worked properly in this case.
|
||||
// Either the quit landed in the offline queue and was flushed at the reconnect
|
||||
// or the offline queue is deactivated and the command was rejected right away
|
||||
// or the stream is not writable
|
||||
@@ -149,7 +149,7 @@ function infoCallback (self, callback) {
|
||||
obj.versions.push(+num);
|
||||
});
|
||||
}
|
||||
// Expose info key/vals to users
|
||||
// Expose info key/values to users
|
||||
self.serverInfo = obj;
|
||||
} else {
|
||||
self.serverInfo = {};
|
||||
|
@@ -21,7 +21,7 @@ function replyToStrings (reply) {
|
||||
if (reply instanceof Array) {
|
||||
var res = new Array(reply.length);
|
||||
for (var i = 0; i < reply.length; i++) {
|
||||
// Recusivly call the function as slowlog returns deep nested replies
|
||||
// Recursively call the function as slowlog returns deep nested replies
|
||||
res[i] = replyToStrings(reply[i]);
|
||||
}
|
||||
return res;
|
||||
@@ -43,9 +43,9 @@ function clone (obj) {
|
||||
}
|
||||
if (Object.prototype.toString.call(obj) === '[object Object]') {
|
||||
copy = {};
|
||||
var elems = Object.keys(obj);
|
||||
var elements = Object.keys(obj);
|
||||
var elem;
|
||||
while (elem = elems.pop()) {
|
||||
while (elem = elements.pop()) {
|
||||
copy[elem] = clone(obj[elem]);
|
||||
}
|
||||
return copy;
|
||||
|
@@ -64,7 +64,7 @@ describe("The 'batch' method", function () {
|
||||
client.end(true);
|
||||
});
|
||||
|
||||
it('returns an empty array and keep the execution order in takt', function (done) {
|
||||
it('returns an empty array and keep the execution order in tact', function (done) {
|
||||
var called = false;
|
||||
client.set('foo', 'bar', function (err, res) {
|
||||
called = true;
|
||||
@@ -78,7 +78,7 @@ describe("The 'batch' method", function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('runs normal calls inbetween batch', function (done) {
|
||||
it('runs normal calls in-between batch', function (done) {
|
||||
var batch = client.batch();
|
||||
batch.set('m1', '123');
|
||||
client.set('m2', '456', done);
|
||||
|
@@ -265,6 +265,7 @@ describe('connection tests', function () {
|
||||
|
||||
describe('when not connected', function () {
|
||||
|
||||
// TODO: Fix this test
|
||||
it.skip('emit an error after the socket timeout exceeded the connectTimeout time', function (done) {
|
||||
var connectTimeout = 500; // in ms
|
||||
client = redis.createClient({
|
||||
|
@@ -933,7 +933,7 @@ describe('The nodeRedis client', function () {
|
||||
});
|
||||
client.once('ready', function () {
|
||||
client.set('foo', 'bar', function (err, res) {
|
||||
assert.strictEqual(err.message, 'Fatal error encountert. Command aborted. It might have been processed.');
|
||||
assert.strictEqual(err.message, 'Fatal error encountered. Command aborted. It might have been processed.');
|
||||
assert.strictEqual(err.code, 'NR_FATAL');
|
||||
assert(err instanceof redis.AbortError);
|
||||
error = err.origin;
|
||||
|
Reference in New Issue
Block a user