You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
chore: mark private variables as such and remove obsolete ones
This commit is contained in:
@@ -22,7 +22,7 @@ function pipelineTransactionCommand (multi, command, index) {
|
||||
if (err) {
|
||||
tmp(err)
|
||||
err.position = index
|
||||
multi.errors.push(err)
|
||||
multi._errors.push(err)
|
||||
return
|
||||
}
|
||||
tmp(null, reply)
|
||||
@@ -73,7 +73,7 @@ function multiCallback (multi, replies) {
|
||||
function execTransaction (multi) {
|
||||
const client = multi._client
|
||||
const queue = multi._queue
|
||||
if (multi.monitoring || client.monitoring) {
|
||||
if (multi._monitoring || client._monitoring) {
|
||||
const err = new RangeError(
|
||||
'Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis.'
|
||||
)
|
||||
@@ -87,9 +87,8 @@ function execTransaction (multi) {
|
||||
})
|
||||
}
|
||||
const len = queue.length
|
||||
multi.errors = []
|
||||
multi._errors = []
|
||||
client._multi = true
|
||||
multi.wantsBuffers = new Array(len)
|
||||
// Silently ignore this error. We'll receive the error for the exec as well
|
||||
const promises = [client.internalSendCommand(new Command('multi', [])).catch(() => {})]
|
||||
// Drain queue, callback will catch 'QUEUED' or error
|
||||
@@ -100,7 +99,7 @@ function execTransaction (multi) {
|
||||
|
||||
const main = client.internalSendCommand(new Command('exec', []))
|
||||
return Promise.all(promises).then(() => main.then((replies) => multiCallback(multi, replies)).catch((err) => {
|
||||
err.errors = multi.errors
|
||||
err.errors = multi._errors
|
||||
return Promise.reject(err)
|
||||
}))
|
||||
}
|
||||
|
Reference in New Issue
Block a user