Skip to content

Commit 85e27d1

Browse files
Add some debugging for recording commits
1 parent 7dd82f4 commit 85e27d1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/db/rustc_commits.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub struct Commit {
1212
}
1313

1414
pub async fn record_commit(db: &DbClient, commit: Commit) -> anyhow::Result<()> {
15+
tracing::trace!("record_commit(sha={})", commit.sha);
1516
let pr = commit.pr.expect("commit has pr");
1617
db.execute(
1718
"INSERT INTO rustc_commits (sha, parent_sha, time, pr) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING",

src/handlers/rustc_commits.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub async fn handle(ctx: &Context, event: &Event) -> anyhow::Result<()> {
7979

8080
/// Fetch commits that are not present in the database.
8181
async fn synchronize_commits(ctx: &Context, sha: &str, pr: u32) {
82+
log::trace!("synchronize_commits for sha={:?}, pr={}", sha, pr);
8283
let db = ctx.db.get().await;
8384
let mut pr = Some(pr);
8485

@@ -110,7 +111,10 @@ async fn synchronize_commits(ctx: &Context, sha: &str, pr: u32) {
110111

111112
let pr = match pr.take() {
112113
Some(number) => number,
113-
None => continue,
114+
None => {
115+
log::warn!("Failed to find PR number for commit {}", sha);
116+
continue;
117+
}
114118
};
115119

116120
let res = rustc_commits::record_commit(

0 commit comments

Comments
 (0)