You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Protect connection retries from application exceptions
This commit is contained in:
16
index.js
16
index.js
@@ -118,7 +118,13 @@ RedisClient.prototype.flush_and_error = function (message) {
|
|||||||
while (this.offline_queue.length > 0) {
|
while (this.offline_queue.length > 0) {
|
||||||
command_obj = this.offline_queue.shift();
|
command_obj = this.offline_queue.shift();
|
||||||
if (typeof command_obj.callback === "function") {
|
if (typeof command_obj.callback === "function") {
|
||||||
command_obj.callback(message);
|
try {
|
||||||
|
command_obj.callback(message);
|
||||||
|
} catch (callback_err) {
|
||||||
|
process.nextTick(function () {
|
||||||
|
throw callback_err;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.offline_queue = new Queue();
|
this.offline_queue = new Queue();
|
||||||
@@ -126,7 +132,13 @@ RedisClient.prototype.flush_and_error = function (message) {
|
|||||||
while (this.command_queue.length > 0) {
|
while (this.command_queue.length > 0) {
|
||||||
command_obj = this.command_queue.shift();
|
command_obj = this.command_queue.shift();
|
||||||
if (typeof command_obj.callback === "function") {
|
if (typeof command_obj.callback === "function") {
|
||||||
command_obj.callback(message);
|
try {
|
||||||
|
command_obj.callback(message);
|
||||||
|
} catch (callback_err) {
|
||||||
|
process.nextTick(function () {
|
||||||
|
throw callback_err;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.command_queue = new Queue();
|
this.command_queue = new Queue();
|
||||||
|
Reference in New Issue
Block a user