update some tracing stuff

This commit is contained in:
mbecker20
2024-05-25 20:46:56 -07:00
parent 0a8419bb13
commit fcbb75d0c0
2 changed files with 9 additions and 6 deletions
+4 -3
View File
@@ -313,6 +313,7 @@ impl Resolve<RunBuild, User> for State {
}
}
#[instrument(skip(update))]
async fn handle_early_return(
mut update: Update,
) -> anyhow::Result<Update> {
@@ -394,7 +395,7 @@ impl Resolve<CancelBuild, User> for State {
const BUILDER_POLL_RATE_SECS: u64 = 2;
const BUILDER_POLL_MAX_TRIES: usize = 30;
#[instrument]
#[instrument(skip_all, fields(build_id = build.id, update_id = update.id))]
async fn get_build_builder(
build: &Build,
update: &mut Update,
@@ -424,7 +425,7 @@ async fn get_build_builder(
}
}
#[instrument]
#[instrument(skip_all, fields(build_id = build.id, update_id = update.id))]
async fn get_aws_builder(
build: &Build,
config: AwsBuilderConfig,
@@ -504,7 +505,7 @@ async fn get_aws_builder(
Err(res.err().unwrap())
}
#[instrument(skip(periphery))]
#[instrument(skip(periphery, update))]
async fn cleanup_builder_instance(
periphery: PeripheryClient,
cleanup_data: BuildCleanupData,
+5 -3
View File
@@ -97,7 +97,7 @@ impl Resolve<CloneRepo, User> for State {
update.finalize();
if update.success {
update_last_pulled(&repo.name).await;
update_last_pulled_time(&repo.name).await;
}
handle_update_return(update).await
@@ -170,13 +170,14 @@ impl Resolve<PullRepo, User> for State {
update.finalize();
if update.success {
update_last_pulled(&repo.name).await;
update_last_pulled_time(&repo.name).await;
}
handle_update_return(update).await
}
}
#[instrument(skip_all, fields(update_id = update.id))]
async fn handle_update_return(
update: Update,
) -> anyhow::Result<Update> {
@@ -198,7 +199,8 @@ async fn handle_update_return(
Ok(update)
}
async fn update_last_pulled(repo_name: &str) {
#[instrument]
async fn update_last_pulled_time(repo_name: &str) {
let res = db_client()
.await
.repos