Skip to content

Commit f0d1077

Browse files
committed
Fix loading of tag, it may be NULL now
1 parent e3247ac commit f0d1077

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

database/src/pool/postgres.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ where
14521452
let benchmark_requests = rows
14531453
.iter()
14541454
.map(|row| {
1455-
let tag = row.get::<_, &str>(0);
1455+
let tag = row.get::<_, Option<&str>>(0);
14561456
let parent_sha = row.get::<_, Option<&str>>(1);
14571457
let pr = row.get::<_, Option<i32>>(2);
14581458
let commit_type = row.get::<_, &str>(3);
@@ -1465,7 +1465,7 @@ where
14651465
match commit_type {
14661466
"try" => {
14671467
let mut try_benchmark = BenchmarkRequest::create_try(
1468-
Some(tag),
1468+
tag,
14691469
parent_sha,
14701470
pr.unwrap() as u32,
14711471
created_at,
@@ -1478,7 +1478,7 @@ where
14781478
}
14791479
"master" => {
14801480
let mut master_benchmark = BenchmarkRequest::create_master(
1481-
tag,
1481+
tag.expect("Master commit in DB without SHA"),
14821482
parent_sha.unwrap(),
14831483
pr.unwrap() as u32,
14841484
created_at,
@@ -1491,7 +1491,11 @@ where
14911491
}
14921492
"release" => {
14931493
let mut release_benchmark = BenchmarkRequest::create_release(
1494-
tag, created_at, status, backends, profiles,
1494+
tag.expect("Release commit in DB witohut SHA"),
1495+
created_at,
1496+
status,
1497+
backends,
1498+
profiles,
14951499
);
14961500
release_benchmark.completed_at = completed_at;
14971501
release_benchmark

0 commit comments

Comments
 (0)