1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Add monitor transaction warning / error

This commit is contained in:
Ruben Bridgewater
2016-04-21 02:54:42 +02:00
parent f7c4d131be
commit eae16938cd
3 changed files with 59 additions and 8 deletions

View File

@@ -85,6 +85,14 @@ function multi_callback (self, err, replies) {
}
Multi.prototype.exec_transaction = function exec_transaction (callback) {
if (this.monitoring || this._client.monitoring) {
var err = new Error(
'Using transaction with a client that is in monitor mode does not work due to faulty return values of Redis.'
);
err.command = 'EXEC';
err.code = 'EXECABORT';
return utils.reply_in_order(this._client, callback, err);
}
var self = this;
var len = self.queue.length;
self.errors = [];