Use RFC 3339 dates in worker endpoint

This commit is contained in:
Joscha 2023-08-14 16:31:44 +02:00
parent dd073b4c0d
commit 3de35e3ac8
4 changed files with 42 additions and 11 deletions

View file

@ -40,7 +40,11 @@ async fn save_work(
let mut tx = db.begin().await?;
let conn = tx.acquire().await?;
let end = finished.end.unwrap_or_else(OffsetDateTime::now_utc);
let end = finished
.end
.map(|t| t.0)
.unwrap_or_else(OffsetDateTime::now_utc);
let bench_method = match finished.run.bench_method {
BenchMethod::Internal => "internal".to_string(),
BenchMethod::Repo { hash } => format!("bench repo, hash {hash}"),
@ -65,7 +69,7 @@ async fn save_work(
bench_method,
worker_name,
worker_info,
finished.run.start,
finished.run.start.0,
end,
finished.exit_code,
)

View file

@ -57,7 +57,7 @@ async fn status(status: &WorkerStatus, db: &SqlitePool, base: &Base) -> somehow:
&unfinished.run.hash,
&message,
),
since: util::format_time(unfinished.run.start),
since: util::format_time(unfinished.run.start.0),
}
}
})