Compare commits
No commits in common. "19562d2db66b556fe16d1cb90c6b52005c556163" and "4578776f578ce04452cae85b8b201f014fc97525" have entirely different histories.
19562d2db6
...
4578776f57
2 changed files with 14 additions and 1 deletions
|
@ -159,6 +159,11 @@ pub(crate) fn shell() -> String {
|
||||||
return "/bin/sh".to_string();
|
return "/bin/sh".to_string();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Default id (`-1`)
|
||||||
|
pub(crate) fn id() -> String {
|
||||||
|
return "-1".to_string();
|
||||||
|
}
|
||||||
|
|
||||||
/// Default revision (`1`)
|
/// Default revision (`1`)
|
||||||
pub(crate) fn revision() -> String {
|
pub(crate) fn revision() -> String {
|
||||||
return "1".to_string();
|
return "1".to_string();
|
||||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -81,7 +81,7 @@ async fn run(config_path: String) {
|
||||||
let job_exit_status = run_job(&state.conf, job_id.clone(), job.clone());
|
let job_exit_status = run_job(&state.conf, job_id.clone(), job.clone());
|
||||||
|
|
||||||
sql::log_job(
|
sql::log_job(
|
||||||
&mut pg_connection,
|
pg_connection.as_mut(),
|
||||||
start_time,
|
start_time,
|
||||||
start_time + job_exit_status.duration,
|
start_time + job_exit_status.duration,
|
||||||
job_exit_status.exit_code,
|
job_exit_status.exit_code,
|
||||||
|
@ -297,6 +297,13 @@ struct State {
|
||||||
dependency_map: HashMap<String, Vec<String>>,
|
dependency_map: HashMap<String, Vec<String>>,
|
||||||
/// A hashmap mapping all job ids to their jobs
|
/// A hashmap mapping all job ids to their jobs
|
||||||
jobs: HashMap<String, Job>,
|
jobs: HashMap<String, Job>,
|
||||||
|
/// The connection to the database
|
||||||
|
///
|
||||||
|
/// Example (from sqlx README, modified)
|
||||||
|
/// ```ignore
|
||||||
|
/// sqlx::query("DELETE FROM table").execute(&mut state.conn).await?;
|
||||||
|
/// ```
|
||||||
|
sql: PgConnection,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl State {
|
impl State {
|
||||||
|
@ -328,6 +335,7 @@ impl State {
|
||||||
conf: conf.clone(),
|
conf: conf.clone(),
|
||||||
jobs: jobs.clone(),
|
jobs: jobs.clone(),
|
||||||
dependency_map: State::dependency_map(jobs, conf),
|
dependency_map: State::dependency_map(jobs, conf),
|
||||||
|
sql: logging::sql::start(5).await,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue