Skip to content

Commit 78bddda

Browse files
committed
fixing runtime max connections
1 parent ee33707 commit 78bddda

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/db/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ async fn get_conn_inner(
2323
.acquire_timeout(Duration::from_secs(10))
2424
.idle_timeout(Duration::from_secs(10))
2525
.max_lifetime(Duration::from_secs(180))
26-
.sqlx_logging(log_sql_statements)
27-
.max_connections(1);
26+
.sqlx_logging(log_sql_statements);
27+
#[cfg(test)]
28+
opt.max_connections(1);
29+
2830
Database::connect(opt).await.map_err(GoatNsError::from)
2931
}
3032

src/tests/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,14 +711,14 @@ async fn test_normalize_ttls() {
711711
/// this test checks that all TTLs in the record are the same when we set normalise_ttls = true
712712
async fn test_dont_normalize_ttls() {
713713
// use crate::zones::FileZoneRecord;
714-
let pool = test_get_sqlite_memory().await;
714+
let dbconn = test_get_sqlite_memory().await;
715715

716-
import_test_zone_file(&pool)
716+
import_test_zone_file(&dbconn)
717717
.await
718718
.expect("Failed to import zone file");
719719

720720
let response = entities::records_merged::Entity::get_records(
721-
&pool,
721+
&dbconn,
722722
"ttltest.hello.goat",
723723
RecordType::A,
724724
RecordClass::Internet,

0 commit comments

Comments
 (0)