Skip to content

Commit

Permalink
Merge pull request #1819 from ehuss/fix-cargo-milestone-timeout
Browse files Browse the repository at this point in the history
Fix cargo milestoning timeout.
  • Loading branch information
ehuss authored Jun 17, 2024
2 parents 1084bd7 + d38e69a commit d2ac789
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/handlers/milestone_prs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
let files = e.issue.diff(&ctx.github).await?;
if let Some(files) = files {
if let Some(cargo) = files.iter().find(|fd| fd.path == "src/tools/cargo") {
milestone_cargo(&ctx.github, &version, &cargo.diff).await?;
// The webhook timeout of 10 seconds can be too short, so process in
// the background.
let diff = cargo.diff.clone();
tokio::task::spawn(async move {
let gh = GithubClient::new_from_env();
if let Err(e) = milestone_cargo(&gh, &version, &diff).await {
log::error!("failed to milestone cargo: {e:?}");
}
});
}
}

Expand Down

0 comments on commit d2ac789

Please sign in to comment.