Skip to content

Commit 2a7370a

Browse files
authored
Merge pull request #1166 from Mark-Simulacrum/log-conflict
Log conflicts on insert into pull_request_build
2 parents 8e6c3d9 + 5678782 commit 2a7370a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

database/src/pool/postgres.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -699,13 +699,14 @@ where
699699
exclude: Option<&str>,
700700
runs: Option<i32>,
701701
) {
702-
self.conn()
702+
if let Err(e) = self.conn()
703703
.execute(
704-
"insert into pull_request_build (pr, complete, requested, include, exclude, runs) VALUES ($1, false, CURRENT_TIMESTAMP, $2, $3, $4) ON CONFLICT DO NOTHING",
704+
"insert into pull_request_build (pr, complete, requested, include, exclude, runs) VALUES ($1, false, CURRENT_TIMESTAMP, $2, $3, $4)",
705705
&[&(pr as i32), &include, &exclude, &runs],
706706
)
707-
.await
708-
.unwrap();
707+
.await {
708+
log::error!("failed to queue_pr({}, {:?}, {:?}, {:?}): {:?}", pr, include, exclude, runs, e);
709+
}
709710
}
710711
async fn pr_attach_commit(&self, pr: u32, sha: &str, parent_sha: &str) -> bool {
711712
self.conn()

0 commit comments

Comments
 (0)