Skip to content

Commit

Permalink
Print duration of task
Browse files Browse the repository at this point in the history
  • Loading branch information
kylerchin committed Apr 24, 2024
1 parent 843c51a commit 4ff7657
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aspen/import_alpenrose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub async fn new_rt_data(
alerts_response_code: Option<u16>,
pool: Arc<CatenaryPostgresPool>,
) -> Result<bool, Box<dyn std::error::Error + Send + Sync>> {
let start = std::time::Instant::now();

let conn_pool = pool.as_ref();
let conn_pre = conn_pool.get().await;

Expand Down Expand Up @@ -398,8 +400,8 @@ pub async fn new_rt_data(
});

println!(
"Updated Chateau {} with realtime data from {}",
chateau_id, realtime_feed_id
"Updated Chateau {} with realtime data from {}, took {} ms",
chateau_id, realtime_feed_id, start.elapsed().as_millis()
);
}
Ok(true)
Expand Down

0 comments on commit 4ff7657

Please sign in to comment.