forked from tungstenfabric/tf-webui-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnect-redis_1.4.5_2.patch
43 lines (38 loc) · 1.39 KB
/
connect-redis_1.4.5_2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- node_modules/connect-redis/node_modules/redis/index.js 2014-12-25 13:54:13.000000000 +0530
+++ node_modules/connect-redis/node_modules/redis/index.js 2014-12-25 13:55:11.000000000 +0530
@@ -6,6 +6,7 @@
to_array = require("./lib/to_array"),
events = require("events"),
crypto = require("crypto"),
+ contrailConfig = require(process.mainModule.exports['corePath'] + '/config/config.global'),
parsers = [], commands,
connection_id = 0,
default_port = 6379,
@@ -57,13 +58,17 @@
this.enable_offline_queue = this.options.enable_offline_queue;
}
+ this.auth_pass = null;
+ if (undefined !== options.auth_pass) {
+ this.auth_pass = options.auth_pass;
+ }
+
this.initialize_retry_vars();
this.pub_sub_mode = false;
this.subscription_set = {};
this.monitoring = false;
this.closing = false;
this.server_info = {};
- this.auth_pass = null;
this.parser_module = null;
this.selected_db = null; // save the selected db here, used when reconnecting
@@ -1096,6 +1101,13 @@
net_client = net.createConnection(port, host);
+ if (undefined !== contrailConfig.redis_password) {
+ if (undefined === options) {
+ options = {};
+ }
+ options['auth_pass'] = contrailConfig.redis_password;
+ }
+
redis_client = new RedisClient(net_client, options);
redis_client.port = port;