From d8116963d4707ca38165a177259fd65809e3a83b Mon Sep 17 00:00:00 2001 From: jakepruitt Date: Mon, 26 Apr 2021 17:26:20 -0700 Subject: [PATCH] Wait until next tick before handling socket errors --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index fe79c5f3935..2ad5f095d7e 100644 --- a/index.js +++ b/index.js @@ -220,7 +220,9 @@ RedisClient.prototype.create_stream = function () { }); this.stream.on('error', function (err) { - self.on_error(err); + process.nextTick(function () { + self.on_error(err); + }); }); this.stream.once('close', function (hadError) {