File tree 2 files changed +13
-14
lines changed
2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,9 @@ version: '3.8'
3
3
services :
4
4
adex-postgres :
5
5
build : ./scripts/postgres
6
- # image: adex-postges
6
+ image : adex-postgres
7
7
container_name : adex-postgres
8
8
restart : always
9
- # volumes:
10
- # - ./scripts/postgres:/docker-entrypoint-initdb.d
11
9
ports :
12
10
- " 5432:5432"
13
11
environment :
Original file line number Diff line number Diff line change @@ -329,17 +329,18 @@ pub mod tests_postgres {
329
329
// DROP the public schema and create it again for usage after recycling
330
330
let queries = "DROP SCHEMA public CASCADE; CREATE SCHEMA public;" ;
331
331
332
- let database_client = database. pool . get ( ) . await . map_err ( |err| {
333
- match & err {
334
- PoolError :: Backend ( backend_err) if backend_err. is_closed ( ) => {
335
- panic ! ( "Closed PG Client connection of the database {} Pool!" , database. name) ;
336
- }
337
- _ => { }
338
- }
339
- err
340
- } ) ?;
341
-
342
- let result = database_client
332
+ database. pool = {
333
+ let mut config = self . base_config . clone ( ) ;
334
+ // set the database in the configuration of the inside Pool (used for tests)
335
+ config. dbname ( & database. name ) ;
336
+
337
+ let manager =
338
+ deadpool_postgres:: Manager :: from_config ( config, NoTls , self . manager_config . clone ( ) ) ;
339
+
340
+ deadpool_postgres:: Pool :: new ( manager, 15 )
341
+ } ;
342
+
343
+ let result = pool. get ( ) . await ?
343
344
. simple_query ( queries)
344
345
. await
345
346
. map_err ( PoolError :: Backend )
You can’t perform that action at this time.
0 commit comments