From 05c266c23ca31bc697223a580111db40bfc966f8 Mon Sep 17 00:00:00 2001 From: asonix Date: Thu, 27 Jul 2023 09:55:13 -0500 Subject: [PATCH] Give verify & admin a different queue than deliver --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e151937..86aac68 100644 --- a/src/main.rs +++ b/src/main.rs @@ -260,6 +260,7 @@ async fn do_server_main( let keys = config.open_keys()?; let spawner = Spawner::build(config.signature_threads())?; + let verify_spawner = Spawner::build((config.signature_threads() / 2).max(1))?; let bind_address = config.bind_address(); let server = HttpServer::new(move || { @@ -282,7 +283,7 @@ async fn do_server_main( .app_data(web::Data::new(job_server)) .app_data(web::Data::new(media.clone())) .app_data(web::Data::new(collector.clone())) - .app_data(web::Data::new(spawner.clone())); + .app_data(web::Data::new(verify_spawner.clone())); let app = if let Some(data) = config.admin_config() { app.app_data(data) @@ -300,7 +301,12 @@ async fn do_server_main( web::resource("/inbox") .wrap(config.digest_middleware()) .wrap(VerifySignature::new( - MyVerify(requests, actors.clone(), state.clone(), spawner.clone()), + MyVerify( + requests, + actors.clone(), + state.clone(), + verify_spawner.clone(), + ), Default::default(), )) .wrap(DebugPayload(config.debug()))