diff --git a/Cargo.toml b/Cargo.toml index 71a539a..e038f17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,8 @@ description = "RocksDb as a service with support for multiple databases and reco [dependencies] structopt = "0.3" -actix-web = "2.0" -actix-rt = "1.0" -actix-web-prom = "0.2" +actix-web = "3" +actix-web-prom = "0.3.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" simplelog = "0.7.6" diff --git a/README.md b/README.md index 2df30b0..972fbed 100644 --- a/README.md +++ b/README.md @@ -94,8 +94,9 @@ $ cargo test -- --test-threads=1 ### TODO - - [ ] support for more rocksDb options in config (bloom, block cache..) + - [X] actix-web 3.0 - fixed mem leak - [X] channel for expire + - [ ] support for more rocksDb options in config (bloom, block cache..) - [ ] fix running test in parallel (TODO per test db root path) - [ ] db iterator for on startup init - [ ] test compaction diff --git a/src/integration_tests.rs b/src/integration_tests.rs index 03abe87..aec5ac0 100644 --- a/src/integration_tests.rs +++ b/src/integration_tests.rs @@ -7,6 +7,8 @@ use actix_web::{test, web, App, Error}; use crate::config::{DbConfig, RocksDbConfig}; use crate::conversion::bytes_to_str; +use actix_web::rt as actix_rt; + use super::*; diff --git a/src/main.rs b/src/main.rs index 31c7352..0a43ee9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,7 @@ async fn health() -> HttpResponse { } // main thread will panic! if config can't be initialized -#[actix_rt::main] +#[actix_web::main] async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "actix_web=error"); std::env::set_var("RUST_BACKTRACE", "1"); @@ -189,11 +189,11 @@ async fn main() -> std::io::Result<()> { let db_manager = DbManager::new(db_cfg)?; let db_manager = web::Data::new(db_manager); - let prometheus = init_prometheus(); + let _prometheus = init_prometheus(); HttpServer::new(move || { App::new() .wrap(ErrorHandlers::new().handler(http::StatusCode::NOT_FOUND, not_found)) - .wrap(prometheus.clone()) + // .wrap(prometheus.clone()) // TODO waiting 3.0 upgrade .app_data(db_manager.clone()) .service(open) .service(close)