remove old todo and format

This commit is contained in:
askiiart 2025-01-30 12:06:40 -06:00
parent e6775f1981
commit 4578776f57
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
2 changed files with 6 additions and 11 deletions

View file

@ -111,7 +111,7 @@ pub(crate) struct JobExitStatus {
/// The name of the container this job ran in /// The name of the container this job ran in
pub(crate) container_name: String, pub(crate) container_name: String,
/// Uuid /// Uuid
pub(crate) job_uuid: String pub(crate) job_uuid: String,
} }
// ========================== // ==========================

View file

@ -73,7 +73,6 @@ async fn run(config_path: String) {
let failed_packages: Vec<String> = Vec::new(); let failed_packages: Vec<String> = Vec::new();
let mut pg_connection = sql::start(5).await; let mut pg_connection = sql::start(5).await;
// runs the jobs (will need to be updated after sorting is added) // runs the jobs (will need to be updated after sorting is added)
@ -81,7 +80,6 @@ async fn run(config_path: String) {
let start_time = SystemTime::now(); let start_time = SystemTime::now();
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());
// TODO: PUSH IT TO THE DB HERE
sql::log_job( sql::log_job(
pg_connection.as_mut(), pg_connection.as_mut(),
start_time, start_time,
@ -91,15 +89,12 @@ async fn run(config_path: String) {
job.revision, job.revision,
job_exit_status.job_uuid, job_exit_status.job_uuid,
job_exit_status.log_path, job_exit_status.log_path,
).await; )
.await;
} }
} }
fn run_job( fn run_job(conf: &Config, job_id: String, job: Job) -> JobExitStatus {
conf: &Config,
job_id: String,
job: Job,
) -> JobExitStatus {
// limit threads to max_threads in the config // limit threads to max_threads in the config
let mut threads = job.threads; let mut threads = job.threads;
if job.threads > conf.max_threads { if job.threads > conf.max_threads {