Skip to content

Commit

Permalink
try to reuse DbConnections better
Browse files Browse the repository at this point in the history
  • Loading branch information
digizeph committed Jan 19, 2024
1 parent f831763 commit 0a9be0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bin/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn main() {
Opts::Update { tal } => {
// The Update subcommand should "catch up" with the latest roas.csv files based on the most recent data files in the database for each tal
rayon::ThreadPoolBuilder::new()
.num_threads(10)
.num_threads(50)
.build_global()
.unwrap();

Expand All @@ -116,15 +116,15 @@ fn main() {
}
};

let mut conn = DbConnection::new();

for (tal, tal_url) in tal_urls {
info!("start updating roas history for {}", tal.as_str());
info!(
"searching for latest roas.csv.xz files from {}",
tal.as_str()
);

let mut conn = DbConnection::new();

// 1. get the latest files date for the given TAL
let latest_file = conn.get_latest_processed_file(tal.as_str()).unwrap();

Expand Down

0 comments on commit 0a9be0f

Please sign in to comment.