Skip to content

Commit 4c768ea

Browse files
committed
Do not warn if a step is ended multiple times
1 parent d58c068 commit 4c768ea

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

collector/src/lib.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,9 @@ pub struct CollectorCtx {
353353
}
354354

355355
impl CollectorCtx {
356-
pub async fn start_compile_step(
357-
&self,
358-
conn: &dyn Connection,
359-
benchmark_name: &BenchmarkName,
360-
) -> bool {
356+
pub async fn start_compile_step(&self, conn: &dyn Connection, benchmark_name: &BenchmarkName) {
361357
conn.collector_start_step(self.artifact_row_id, &benchmark_name.0)
362-
.await
358+
.await;
363359
}
364360

365361
pub async fn end_compile_step(&self, conn: &dyn Connection, benchmark_name: &BenchmarkName) {

database/src/pool/postgres.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,19 +1095,14 @@ where
10951095
== 1
10961096
}
10971097
async fn collector_end_step(&self, aid: ArtifactIdNumber, step: &str) {
1098-
let did_modify = self
1099-
.conn()
1098+
self.conn()
11001099
.execute(
11011100
"update collector_progress set end_time = statement_timestamp() \
1102-
where aid = $1 and step = $2 and start_time is not null and end_time is null;",
1101+
where aid = $1 and step = $2 and start_time is not null;",
11031102
&[&(aid.0 as i32), &step],
11041103
)
11051104
.await
1106-
.unwrap()
1107-
== 1;
1108-
if !did_modify {
1109-
log::error!("did not end {} for {:?}", step, aid);
1110-
}
1105+
.unwrap();
11111106
}
11121107
async fn collector_remove_step(&self, aid: ArtifactIdNumber, step: &str) {
11131108
self.conn()

database/src/pool/sqlite.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,18 +1050,13 @@ impl Connection for SqliteConnection {
10501050
}
10511051

10521052
async fn collector_end_step(&self, aid: ArtifactIdNumber, step: &str) {
1053-
let did_modify = self
1054-
.raw_ref()
1053+
self.raw_ref()
10551054
.execute(
10561055
"update collector_progress set end = strftime('%s','now') \
1057-
where aid = ? and step = ? and start is not null and end is null;",
1056+
where aid = ? and step = ? and start is not null;",
10581057
params![&aid.0, &step],
10591058
)
1060-
.unwrap()
1061-
== 1;
1062-
if !did_modify {
1063-
log::error!("did not end {} for {:?}", step, aid);
1064-
}
1059+
.unwrap();
10651060
}
10661061

10671062
async fn collector_remove_step(&self, aid: ArtifactIdNumber, step: &str) {

0 commit comments

Comments
 (0)