Add flag to purge dead accounts on startup

This commit is contained in:
Ethan O'Brien
2024-10-18 16:08:05 -05:00
parent e0730a9fa6
commit 993f6f1e39
5 changed files with 67 additions and 10 deletions

View File

@@ -64,7 +64,10 @@ pub struct Args {
max_time: u64,
#[arg(long, default_value_t = false, help = "Disable webui, act completely like the original server")]
hidden: bool
hidden: bool,
#[arg(long, default_value_t = false, help = "Purge dead user accounts on startup")]
purge: bool
}
#[actix_web::main]
@@ -72,6 +75,12 @@ async fn main() -> std::io::Result<()> {
let args = get_args();
let port = args.port;
if args.purge {
println!("Purging accounts...");
let ct = crate::router::userdata::purge_accounts();
println!("Purged {} accounts", ct);
}
let rv = HttpServer::new(|| App::new()
.wrap_fn(|req, srv| {
println!("Request: {}", req.path());