diff --git a/lib/redis.js b/lib/redis.js index e4498943..eb53238f 100644 --- a/lib/redis.js +++ b/lib/redis.js @@ -391,7 +391,13 @@ Redis.prototype.end = function () { * @public */ Redis.prototype.duplicate = function (override) { - return new Redis(Object.assign({}, this.options, override || {})); + const r = new Redis(Object.assign({}, this.options, override || {})); + for (let name of this.eventNames()) { + for (let handler of this.listeners(name)) { + r.on(name, handler); + } + } + return r; }; Redis.prototype.recoverFromFatalError = function (commandError, err, options) {