You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
chore: add callback functionality back in
This also improves the performance for multi / batch commands a lot. The reason is that now there are only callbacks internally even if a promise is going to be returned in the end.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use strict'
|
||||
|
||||
const Command = require('./command')
|
||||
const { Command, MultiCommand } = require('./command')
|
||||
|
||||
function addCommand(clientProto, multiProto, command) {
|
||||
// Some rare Redis commands use special characters in their command name
|
||||
@@ -28,7 +28,7 @@ function addCommand(clientProto, multiProto, command) {
|
||||
// Do not override existing functions
|
||||
if (!multiProto[command] && command !== 'multi') {
|
||||
multiProto[commandName] = function (...args) {
|
||||
this._queue.push(new Command(command, args))
|
||||
this._queue.push(new MultiCommand(command, args))
|
||||
return this
|
||||
}
|
||||
if (!multiProto[commandName].name) {
|
||||
|
Reference in New Issue
Block a user