···2222 /// path to a local fjall database directory (alternative to postgres)
2323 #[arg(long, env = "ALLEGEDLY_WRAP_FJALL", conflicts_with_all = ["wrap_pg", "wrap_pg_cert"])]
2424 wrap_fjall: Option<PathBuf>,
2525+ /// compact the fjall db on startup
2626+ #[arg(
2727+ long,
2828+ env = "ALLEGEDLY_FJALL_COMPACT",
2929+ conflicts_with_all = ["wrap_pg", "wrap_pg_cert"]
3030+ )]
3131+ compact_fjall: bool,
2532 /// wrapping server listen address
2633 #[arg(short, long, env = "ALLEGEDLY_BIND")]
2734 #[clap(default_value = "127.0.0.1:8000")]
···7481 wrap_pg,
7582 wrap_pg_cert,
7683 wrap_fjall,
8484+ compact_fjall,
7785 bind,
7886 acme_domain,
7987 acme_cache_path,
···112120113121 if let Some(fjall_path) = wrap_fjall {
114122 let db = FjallDb::open(&fjall_path)?;
123123+ if compact_fjall {
124124+ log::info!("compacting fjall...");
125125+ db.compact()?; // blocking here is fine, we didn't start anything yet
126126+ }
115127116128 log::debug!("getting the latest op from fjall...");
117129 let latest = db
118130 .get_latest()?
119131 .expect("there to be at least one op in the db. did you backfill?");
120120- log::debug!("starting polling from {latest}...");
132132+ log::info!("starting polling from {latest}...");
121133122134 let (send_page, recv_page) = mpsc::channel(8);
123135