Actually run the damn thing

This commit is contained in:
Garrett Mills 2025-02-25 00:28:52 -05:00
parent ed7b167167
commit da4a2a6e0c

View File

@ -13,17 +13,16 @@ pub mod services;
/** Perform any init-time operations that require the DB. */ /** Perform any init-time operations that require the DB. */
pub fn post_init() -> AdHoc { pub fn post_init() -> AdHoc {
AdHoc::on_ignite("post_init", |rocket| async { AdHoc::on_liftoff("post_init", |rocket| Box::pin(async move {
let conn = &Db::fetch(&rocket).unwrap().conn; let conn = &Db::fetch(&rocket).unwrap().conn;
ensure_vmid_lock(&conn).await.unwrap(); ensure_vmid_lock(conn).await.unwrap();
}))
rocket
})
} }
pub fn init() -> AdHoc { pub fn init() -> AdHoc {
AdHoc::on_ignite("mod(db)", |rocket| async { AdHoc::on_ignite("mod(db)", |rocket| async {
rocket.attach(db::init()) rocket.attach(db::init())
.attach(route::init()) .attach(route::init())
.attach(post_init())
}) })
} }