Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
prydonius committed Oct 14, 2024
1 parent f400e01 commit fdb6904
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion synth/src/cli/mongo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ impl ExportStrategy for MongoExportStrategy {
info!("Connecting to database at {} ...", &self.uri_string);

let mut client = Client::with_options(client_options)?;
// let mut client = Client::with_uri_str(&self.uri_string)?;

match sample {
SamplerOutput::Collection(name, value) => {
Expand Down
3 changes: 0 additions & 3 deletions synth/src/datasource/mysql_datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rust_decimal::Decimal;
use sqlx::mysql::{MySqlColumn, MySqlPoolOptions, MySqlRow};
use sqlx::{Column, MySql, Pool, Row, TypeInfo};
use std::collections::BTreeMap;
use std::time::Duration;
use synth_core::schema::number_content::{F64, I16, I32, I64, I8, U64};
use synth_core::schema::{
ChronoValueType, DateTimeContent, NumberContent, RangeStep, RegexContent, StringContent,
Expand All @@ -28,7 +27,6 @@ pub struct MySqlConnectParams {
pub(crate) concurrency: usize,
}

#[derive(Clone)]
pub struct MySqlDataSource {
pool: Pool<MySql>,
concurrency: usize,
Expand All @@ -42,7 +40,6 @@ impl DataSource for MySqlDataSource {
task::block_on(async {
let pool = MySqlPoolOptions::new()
.max_connections(connect_params.concurrency.try_into().unwrap())
.acquire_timeout(Duration::from_secs(600))
.connect(connect_params.uri.as_str())
.await?;

Expand Down
7 changes: 0 additions & 7 deletions synth/src/datasource/relational_datasource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,6 @@ where
collection_name
);

let mut num_jobs = 0;

let semaphore = Arc::new(Semaphore::new(max_concurrency));
for rows in collection_chunks {
let permit = semaphore.clone().acquire_arc().await;
Expand Down Expand Up @@ -260,15 +258,10 @@ where
drop(permit);
result
});
num_jobs += 1;

futures.push(future);
}

info!(
"Waiting for {} jobs for collection {}...",
num_jobs, collection_name
);
let results = join_all(futures).await;

if let Err(e) = results.into_iter().bcollect::<Vec<_>>() {
Expand Down

0 comments on commit fdb6904

Please sign in to comment.