Skip to content

Commit

Permalink
Fix lint, fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevenannn committed Sep 28, 2024
1 parent 95feb03 commit c960de9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/sql/db_connection_pool/sqlitepool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl SqliteConnectionPool {

pub async fn setup(&self) -> Result<()> {
let conn = self.conn.clone();
let busy_timeout = self.busy_timeout.clone();
let busy_timeout = self.busy_timeout;

// these configuration options are only applicable for file-mode databases
if self.mode == Mode::File {
Expand Down Expand Up @@ -226,7 +226,7 @@ impl SqliteConnectionPool {
mode: self.mode,
path: Arc::clone(&self.path),
attach_databases: self.attach_databases.clone(),
busy_timeout: self.busy_timeout.clone(),
busy_timeout: self.busy_timeout,
}),
Mode::File => {
let attach_databases = if self.attach_databases.is_empty() {
Expand Down
6 changes: 3 additions & 3 deletions src/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ impl SqliteTableProviderFactory {
}
.build()
})?;
return Ok(Duration::from_millis(result));
Ok(Duration::from_millis(result))
}
None => return Ok(Duration::from_millis(5000)),
};
None => Ok(Duration::from_millis(5000)),
}
}

pub async fn get_or_init_instance(
Expand Down
12 changes: 8 additions & 4 deletions tests/sqlite/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ async fn arrow_sqlite_round_trip(
tracing::debug!("Running tests on {table_name}");
let ctx = SessionContext::new();

let pool = SqliteConnectionPoolFactory::new(":memory:", Mode::Memory)
.build()
.await
.expect("Sqlite connection pool to be created");
let pool = SqliteConnectionPoolFactory::new(
":memory:",
Mode::Memory,
std::time::Duration::from_millis(5000),
)
.build()
.await
.expect("Sqlite connection pool to be created");

let conn = pool
.connect()
Expand Down

0 comments on commit c960de9

Please sign in to comment.