chore: format and clean up code

This commit is contained in:
askiiart 2025-01-17 22:58:41 -06:00
parent 97cacf0b56
commit 7d5d51f6e1
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
8 changed files with 12 additions and 22 deletions

View file

@ -1,6 +1,6 @@
services: services:
postgres: postgres:
image: 'docker.io/library/postgres:17-alpine' image: "docker.io/library/postgres:17-alpine"
environment: environment:
- POSTGRES_PASSWORD=ReplaceMeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee - POSTGRES_PASSWORD=ReplaceMeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
# if there's already a he/him gregory down the hall, then change it to `gregory_it_its`, to make sure you know it's gregory, the program, not gregory the he/him down the hall # if there's already a he/him gregory down the hall, then change it to `gregory_it_its`, to make sure you know it's gregory, the program, not gregory the he/him down the hall
@ -9,6 +9,6 @@ services:
- POSTGRES_USER=gregory - POSTGRES_USER=gregory
- POSTGRES_DB=gregory - POSTGRES_DB=gregory
volumes: volumes:
- './data:/var/lib/postgresql/data' - "./data:/var/lib/postgresql/data"
ports: ports:
- 9001:5432 - 9001:5432

View file

@ -1,10 +1,6 @@
use crate::errors::Error; use crate::errors::Error;
use std::fs::{File, OpenOptions};
use std::io::Write; use std::io::Write;
use std::sync::{Arc, Mutex};
use std::{
fs::{File, OpenOptions},
os::unix::fs::FileExt,
};
/// The logger for gregory itself - NOT for jobs /// The logger for gregory itself - NOT for jobs
pub(crate) struct Logger { pub(crate) struct Logger {
@ -80,5 +76,4 @@ impl JobLogger {
} }
} }
} }
} }

View file

@ -1,10 +1,8 @@
use crate::cli::*; use crate::cli::*;
use crate::data::*; use crate::data::*;
use alphanumeric_sort::sort_str_slice;
use better_commands; use better_commands;
use clap::{CommandFactory, Parser}; use clap::{CommandFactory, Parser};
use clap_complete::aot::{generate, Bash, Elvish, Fish, PowerShell, Zsh}; use clap_complete::aot::{generate, Bash, Elvish, Fish, PowerShell, Zsh};
use std::fs;
use std::fs::create_dir_all; use std::fs::create_dir_all;
use std::fs::remove_dir_all; use std::fs::remove_dir_all;
use std::fs::write; use std::fs::write;
@ -15,7 +13,6 @@ use std::path::Path;
use std::process::Command; use std::process::Command;
use std::sync::Arc; use std::sync::Arc;
use std::sync::Mutex; use std::sync::Mutex;
use std::time::Instant;
use uuid::Uuid; use uuid::Uuid;
mod cli; mod cli;
@ -97,7 +94,6 @@ fn run_job(conf: Config, job: Job) -> JobExitStatus {
logging::JobLogger::new(log_path.clone()).unwrap(), logging::JobLogger::new(log_path.clone()).unwrap(),
)); ));
// write the script // write the script
let script_path = &format!("{}/tmp/{container_name}.sh", conf.data_dir); // can't select fields in the format!() {} thing, have to do this let script_path = &format!("{}/tmp/{container_name}.sh", conf.data_dir); // can't select fields in the format!() {} thing, have to do this
let script_dir: &Path = Path::new(script_path).parent().unwrap(); // create dir for the script let script_dir: &Path = Path::new(script_path).parent().unwrap(); // create dir for the script

View file

@ -1,4 +1,3 @@
use crate::data;
#[cfg(test)] #[cfg(test)]
use alphanumeric_sort::sort_str_slice; use alphanumeric_sort::sort_str_slice;