insert subscription, db test isolation
This commit is contained in:
@ -6,10 +6,10 @@ use zero2prod::startup::run;
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let config = get_configuration().expect("Failed to read configuration");
|
||||
let connection = PgPoolOptions::new()
|
||||
let connection_pool = PgPoolOptions::new()
|
||||
.max_connections(10).connect(&config.database.connection_string()).await.expect("Failed to connect to Postgres.");
|
||||
|
||||
let address = format!("127.0.0.1:{}", config.application_port);
|
||||
let listener = TcpListener::bind(address).expect("Failed to bind random port");
|
||||
run(listener, connection)?.await
|
||||
run(listener, connection_pool)?.await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user