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

Only initiate the parser once per instance and throw sync if the parser can't be found

This commit is contained in:
Ruben Bridgewater
2015-11-22 17:01:10 +01:00
parent d3352bf550
commit 634dcee859
2 changed files with 10 additions and 13 deletions

View File

@@ -90,7 +90,8 @@ function RedisClient(options) {
this.old_state = null;
this.pipeline = 0;
this.options = options;
// Init parser once per instance
this.init_parser();
self.stream = net.createConnection(cnx_options);
self.install_stream_listeners();
}
@@ -256,8 +257,6 @@ RedisClient.prototype.on_connect = function () {
this.stream.setKeepAlive(this.options.socket_keepalive);
this.stream.setTimeout(0);
this.init_parser();
if (typeof this.auth_pass === 'string') {
this.do_auth();
} else {