···22 /// path to a local fjall database directory (alternative to postgres)
23 #[arg(long, env = "ALLEGEDLY_WRAP_FJALL", conflicts_with_all = ["wrap_pg", "wrap_pg_cert"])]
24 wrap_fjall: Option<PathBuf>,
000000025 /// wrapping server listen address
26 #[arg(short, long, env = "ALLEGEDLY_BIND")]
27 #[clap(default_value = "127.0.0.1:8000")]
···74 wrap_pg,
75 wrap_pg_cert,
76 wrap_fjall,
077 bind,
78 acme_domain,
79 acme_cache_path,
···112113 if let Some(fjall_path) = wrap_fjall {
114 let db = FjallDb::open(&fjall_path)?;
0000115116 log::debug!("getting the latest op from fjall...");
117 let latest = db
118 .get_latest()?
119 .expect("there to be at least one op in the db. did you backfill?");
120- log::debug!("starting polling from {latest}...");
121122 let (send_page, recv_page) = mpsc::channel(8);
123
···22 /// path to a local fjall database directory (alternative to postgres)
23 #[arg(long, env = "ALLEGEDLY_WRAP_FJALL", conflicts_with_all = ["wrap_pg", "wrap_pg_cert"])]
24 wrap_fjall: Option<PathBuf>,
25+ /// compact the fjall db on startup
26+ #[arg(
27+ long,
28+ env = "ALLEGEDLY_FJALL_COMPACT",
29+ conflicts_with_all = ["wrap_pg", "wrap_pg_cert"]
30+ )]
31+ compact_fjall: bool,
32 /// wrapping server listen address
33 #[arg(short, long, env = "ALLEGEDLY_BIND")]
34 #[clap(default_value = "127.0.0.1:8000")]
···81 wrap_pg,
82 wrap_pg_cert,
83 wrap_fjall,
84+ compact_fjall,
85 bind,
86 acme_domain,
87 acme_cache_path,
···120121 if let Some(fjall_path) = wrap_fjall {
122 let db = FjallDb::open(&fjall_path)?;
123+ if compact_fjall {
124+ log::info!("compacting fjall...");
125+ db.compact()?; // blocking here is fine, we didn't start anything yet
126+ }
127128 log::debug!("getting the latest op from fjall...");
129 let latest = db
130 .get_latest()?
131 .expect("there to be at least one op in the db. did you backfill?");
132+ log::info!("starting polling from {latest}...");
133134 let (send_page, recv_page) = mpsc::channel(8);
135