File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,12 @@ pub mod redis_pool {
164
164
connections : DashMap < u8 , Option < Database > > ,
165
165
}
166
166
167
+ impl Default for Manager {
168
+ fn default ( ) -> Self {
169
+ Self :: new ( )
170
+ }
171
+ }
172
+
167
173
impl Manager {
168
174
/// The maximum databases that Redis has by default is 16, with DB `0` as default.
169
175
const CONNECTIONS : u8 = 16 ;
@@ -237,7 +243,7 @@ pub mod redis_pool {
237
243
// run `FLUSHDB` to clean any leftovers of previous tests
238
244
Self :: flush_db ( & mut database. connection )
239
245
. await
240
- . map_err ( |err| RecycleError :: Backend ( err ) ) ?;
246
+ . map_err ( RecycleError :: Backend ) ?;
241
247
database. available = true ;
242
248
243
249
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -127,25 +127,20 @@ fn get_request_ip(req: &Request<Body>) -> Option<String> {
127
127
128
128
#[ cfg( test) ]
129
129
mod test {
130
- use hyper:: Request ;
131
130
use adapter:: DummyAdapter ;
131
+ use hyper:: Request ;
132
132
use primitives:: adapter:: DummyAdapterOptions ;
133
133
134
134
use primitives:: util:: tests:: prep_db:: { AUTH , IDS } ;
135
135
136
-
137
- use primitives:: {
138
- config:: configuration,
139
- Config ,
140
- } ;
136
+ use primitives:: { config:: configuration} ;
141
137
142
138
use deadpool:: managed:: Object ;
143
139
144
140
use crate :: {
145
141
db:: redis_pool:: { Database , TESTS_POOL } ,
146
142
Session ,
147
143
} ;
148
- use std:: env;
149
144
150
145
use super :: * ;
151
146
@@ -157,7 +152,6 @@ mod test {
157
152
dummy_auth_tokens : AUTH . clone ( ) ,
158
153
} ;
159
154
let config = configuration ( "development" , None ) . expect ( "Dev config should be available" ) ;
160
- let url = env:: var ( "REDIS_URL" ) . unwrap_or_else ( |_| String :: from ( "redis://127.0.0.1:6379" ) ) ;
161
155
162
156
( DummyAdapter :: init ( adapter_options, & config) , connection)
163
157
}
You can’t perform that action at this time.
0 commit comments