fix: update rocket version

This commit is contained in:
timokoesters 2020-06-16 13:53:15 +02:00
parent 0f72bd9f32
commit db685e0cf7
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
3 changed files with 111 additions and 124 deletions

View file

@ -94,18 +94,19 @@ fn setup_rocket() -> rocket::Rocket {
//server_server::get_server_keys_deprecated,
],
)
.attach(AdHoc::on_attach("Config", |rocket| {
let data = Database::load_or_create(&rocket.config()).expect("valid config");
.attach(AdHoc::on_attach("Config", |mut rocket| async {
let data = Database::load_or_create(rocket.config().await).expect("valid config");
Ok(rocket.manage(data))
}))
}
fn main() {
// Log info by default
#[rocket::main]
async fn main() {
// Default log level
if std::env::var("ROCKET_LOG").is_err() {
std::env::set_var("ROCKET_LOG", "critical");
}
setup_rocket().launch().unwrap();
setup_rocket().launch().await.unwrap();
}