File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,13 @@ module.exports = CoreObject.extend({
31
31
RedisLib = require ( 'ioredis' ) ;
32
32
}
33
33
34
- this . _client = new RedisLib ( libOptions ) ;
35
-
34
+ if ( libOptions . url ) {
35
+ let url = libOptions . url ;
36
+ delete libOptions . url ;
37
+ this . _client = new RedisLib ( url , libOptions ) ;
38
+ } else {
39
+ this . _client = new RedisLib ( libOptions ) ;
40
+ }
36
41
this . _maxRecentUploads = options . maxRecentUploads || 10 ;
37
42
this . _allowOverwrite = options . allowOverwrite || false ;
38
43
this . _activationSuffix = options . activationSuffix || 'current' ;
Original file line number Diff line number Diff line change @@ -94,13 +94,16 @@ describe("redis plugin", function() {
94
94
plugin . configure ( context ) ;
95
95
plugin . readConfig ( "redisDeployClient" ) ;
96
96
97
- assert . isTrue (
98
- redisLibStub . calledWith ( {
99
- host : "somehost" ,
100
- port : 1234 ,
101
- db : 4 ,
102
- tls : { rejectUnauthorized : false }
103
- } )
97
+ assert . deepEqual (
98
+ redisLibStub . lastCall . args ,
99
+ [
100
+ {
101
+ host : "somehost" ,
102
+ port : 1234 ,
103
+ db : 4 ,
104
+ tls : { rejectUnauthorized : false }
105
+ }
106
+ ]
104
107
) ;
105
108
} ) ;
106
109
@@ -126,8 +129,9 @@ describe("redis plugin", function() {
126
129
plugin . configure ( context ) ;
127
130
plugin . readConfig ( "redisDeployClient" ) ;
128
131
129
- assert . isTrue (
130
- redisLibStub . calledWith ( { url : "redis://:password@host.amazonaws.com:6379/4" } )
132
+ assert . deepEqual (
133
+ redisLibStub . lastCall . args ,
134
+ [ "redis://:password@host.amazonaws.com:6379/4" , { } ] ,
131
135
) ;
132
136
} ) ;
133
137
@@ -153,7 +157,7 @@ describe("redis plugin", function() {
153
157
plugin . readConfig ( "redisDeployClient" ) ;
154
158
155
159
assert . isTrue (
156
- redisLibStub . calledWith ( { url : "redis://:password@host.amazonaws.com:6379/4" } )
160
+ redisLibStub . calledWith ( "redis://:password@host.amazonaws.com:6379/4" )
157
161
) ;
158
162
} ) ;
159
163
You can’t perform that action at this time.
0 commit comments