Skip to content

Commit

Permalink
Add name property to all Redis functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Bridgewater committed May 28, 2016
1 parent 55528d8 commit ffaaf0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Features
- Updated [redis-parser](https://github.com/NodeRedis/redis-parser) dependency ([changelog](https://github.com/NodeRedis/redis-parser/releases/tag/v.2.0.0))
- The JS parser is from now on the new default as it is a lot faster than the hiredis parser
- This is no BC as there is no changed behavior for the user at all but just a performance improvement. Explicitly requireing the Hiredis parser is still possible.
- Added name property to all Redis functions

Bugfixes

Expand Down
6 changes: 6 additions & 0 deletions lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ commands.list.forEach(function (command) {
}
return this.internal_send_command(command, arr, callback);
};
Object.defineProperty(RedisClient.prototype[command], 'name', {
value: command
});
}

// Do not override existing functions
Expand Down Expand Up @@ -82,5 +85,8 @@ commands.list.forEach(function (command) {
this.queue.push([command, arr, callback]);
return this;
};
Object.defineProperty(Multi.prototype[command], 'name', {
value: command
});
}
});
4 changes: 2 additions & 2 deletions lib/individualCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function quit_callback (self, callback) {
};
}

RedisClient.prototype.QUIT = RedisClient.prototype.quit = function (callback) {
RedisClient.prototype.QUIT = RedisClient.prototype.quit = function quit (callback) {
// TODO: Consider this for v.3
// Allow the quit command to be fired as soon as possible to prevent it landing in the offline queue.
// this.ready = this.offline_queue.length === 0;
Expand All @@ -108,7 +108,7 @@ RedisClient.prototype.QUIT = RedisClient.prototype.quit = function (callback) {
};

// Only works with batch, not in a transaction
Multi.prototype.QUIT = Multi.prototype.quit = function (callback) {
Multi.prototype.QUIT = Multi.prototype.quit = function quit (callback) {
var self = this._client;
var call_on_write = function () {
// If called in a multi context, we expect redis is available
Expand Down

0 comments on commit ffaaf0f

Please sign in to comment.