diff --git a/Cargo.lock b/Cargo.lock index 3dbaf7e..07a24de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -467,7 +467,8 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-cpupool" version = "0.1.0" -source = "git+https://git.asonix.dog/safe-async/async-cpupool#2884d854fff83e96ad70b8dc06e947377d53e1b7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba06506d5e5f2e45254bfb3175d5ca14b7dbb817cf0651cc2cc3a8b18a12c5a5" dependencies = [ "flume", "metrics", diff --git a/Cargo.toml b/Cargo.toml index ccff3b5..761a40e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ actix-webfinger = { version = "0.5.0", default-features = false } activitystreams = "0.7.0-alpha.25" activitystreams-ext = "0.1.0-alpha.3" ammonia = "3.1.0" -async-cpupool = { version = "0.1.0", git = "https://git.asonix.dog/safe-async/async-cpupool" } +async-cpupool = "0.1.0" bcrypt = "0.15" base64 = "0.21" clap = { version = "4.0.0", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index 085aca3..897878d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -311,8 +311,8 @@ async fn do_server_main( } }; - let verify_spawner = Spawner::build("verify-cpu", verify_threads.try_into()?); - let sign_spawner = Spawner::build("sign-cpu", signature_threads.try_into()?); + let verify_spawner = Spawner::build("verify-cpu", verify_threads.try_into()?)?; + let sign_spawner = Spawner::build("sign-cpu", signature_threads.try_into()?)?; let key_id = config.generate_url(UrlKind::MainKey).to_string(); let state = State::build(db.clone(), key_id, sign_spawner.clone(), client).await?; diff --git a/src/spawner.rs b/src/spawner.rs index c9f8d1b..9f5cbba 100644 --- a/src/spawner.rs +++ b/src/spawner.rs @@ -8,14 +8,13 @@ pub(crate) struct Spawner { } impl Spawner { - pub(crate) fn build(name: &'static str, threads: u16) -> Self { + pub(crate) fn build(name: &'static str, threads: u16) -> anyhow::Result { let pool = CpuPool::configure() .name(name) .max_threads(threads) - .build() - .expect("valid configuration"); + .build()?; - Spawner { pool } + Ok(Spawner { pool }) } pub(crate) async fn close(self) {