Include worker name and info in run
This commit is contained in:
parent
01124d719b
commit
dd073b4c0d
4 changed files with 26 additions and 15 deletions
12
.sqlx/query-7af4a1edc6f7cf718fee6562c8c6fb5eaa63a4965082f3c54390ee71e4dd3a15.json
generated
Normal file
12
.sqlx/query-7af4a1edc6f7cf718fee6562c8c6fb5eaa63a4965082f3c54390ee71e4dd3a15.json
generated
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"db_name": "SQLite",
|
||||||
|
"query": "INSERT INTO runs ( id, hash, bench_method, worker_name, worker_info, start, end, exit_code ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ",
|
||||||
|
"describe": {
|
||||||
|
"columns": [],
|
||||||
|
"parameters": {
|
||||||
|
"Right": 8
|
||||||
|
},
|
||||||
|
"nullable": []
|
||||||
|
},
|
||||||
|
"hash": "7af4a1edc6f7cf718fee6562c8c6fb5eaa63a4965082f3c54390ee71e4dd3a15"
|
||||||
|
}
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"db_name": "SQLite",
|
|
||||||
"query": "INSERT INTO runs ( id, hash, bench_method, start, end, exit_code ) VALUES (?, ?, ?, ?, ?, ?) ",
|
|
||||||
"describe": {
|
|
||||||
"columns": [],
|
|
||||||
"parameters": {
|
|
||||||
"Right": 6
|
|
||||||
},
|
|
||||||
"nullable": []
|
|
||||||
},
|
|
||||||
"hash": "d1e7da8b6a2018e621e3fd6d7a74668a82fabb1d83bdfc8bf763bff733b3388c"
|
|
||||||
}
|
|
||||||
|
|
@ -2,6 +2,8 @@ CREATE TABLE runs (
|
||||||
id TEXT NOT NULL PRIMARY KEY,
|
id TEXT NOT NULL PRIMARY KEY,
|
||||||
hash TEXT NOT NULL,
|
hash TEXT NOT NULL,
|
||||||
bench_method TEXT NOT NULL,
|
bench_method TEXT NOT NULL,
|
||||||
|
worker_name TEXT NOT NULL,
|
||||||
|
worker_info TEXT,
|
||||||
start TEXT NOT NULL,
|
start TEXT NOT NULL,
|
||||||
end TEXT NOT NULL,
|
end TEXT NOT NULL,
|
||||||
exit_code INT NOT NULL,
|
exit_code INT NOT NULL,
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,12 @@ use crate::{
|
||||||
somehow,
|
somehow,
|
||||||
};
|
};
|
||||||
|
|
||||||
async fn save_work(finished: FinishedRun, db: &SqlitePool) -> somehow::Result<()> {
|
async fn save_work(
|
||||||
|
finished: FinishedRun,
|
||||||
|
worker_name: &str,
|
||||||
|
worker_info: &Option<String>,
|
||||||
|
db: &SqlitePool,
|
||||||
|
) -> somehow::Result<()> {
|
||||||
let mut tx = db.begin().await?;
|
let mut tx = db.begin().await?;
|
||||||
let conn = tx.acquire().await?;
|
let conn = tx.acquire().await?;
|
||||||
|
|
||||||
|
|
@ -47,15 +52,19 @@ async fn save_work(finished: FinishedRun, db: &SqlitePool) -> somehow::Result<()
|
||||||
id, \
|
id, \
|
||||||
hash, \
|
hash, \
|
||||||
bench_method, \
|
bench_method, \
|
||||||
|
worker_name, \
|
||||||
|
worker_info, \
|
||||||
start, \
|
start, \
|
||||||
end, \
|
end, \
|
||||||
exit_code \
|
exit_code \
|
||||||
) \
|
) \
|
||||||
VALUES (?, ?, ?, ?, ?, ?) \
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?) \
|
||||||
",
|
",
|
||||||
finished.run.id,
|
finished.run.id,
|
||||||
finished.run.hash,
|
finished.run.hash,
|
||||||
bench_method,
|
bench_method,
|
||||||
|
worker_name,
|
||||||
|
worker_info,
|
||||||
finished.run.start,
|
finished.run.start,
|
||||||
end,
|
end,
|
||||||
finished.exit_code,
|
finished.exit_code,
|
||||||
|
|
@ -133,7 +142,7 @@ pub async fn post_api_worker_status(
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Some(run) = request.submit_run {
|
if let Some(run) = request.submit_run {
|
||||||
save_work(run, &db).await?;
|
save_work(run, &name, &request.info, &db).await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch queue
|
// Fetch queue
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue