From 0a9be0f28850f5ca0674c0017a193acb25003f6a Mon Sep 17 00:00:00 2001 From: Mingwei Zhang Date: Thu, 18 Jan 2024 18:33:26 -0800 Subject: [PATCH] try to reuse DbConnections better --- src/bin/updater.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/updater.rs b/src/bin/updater.rs index cedb36c..d95a6a6 100644 --- a/src/bin/updater.rs +++ b/src/bin/updater.rs @@ -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(); @@ -116,6 +116,8 @@ fn main() { } }; + let mut conn = DbConnection::new(); + for (tal, tal_url) in tal_urls { info!("start updating roas history for {}", tal.as_str()); info!( @@ -123,8 +125,6 @@ fn main() { 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();