From c4b09270a770b652b99d2ff7dea789ced14fa7bc Mon Sep 17 00:00:00 2001 From: Jai A Date: Mon, 24 Jun 2024 22:41:31 -0700 Subject: [PATCH] update concurrency limit --- .env | 2 ++ daedalus_client/src/main.rs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 13c7136..9aac220 100644 --- a/.env +++ b/.env @@ -2,6 +2,8 @@ RUST_LOG=warn,daedalus_client=trace BASE_URL=http://localhost:9000/meta +CONCURRENCY_LIMIT=10 + S3_ACCESS_TOKEN=none S3_SECRET=none S3_URL=http://localhost:9000 diff --git a/daedalus_client/src/main.rs b/daedalus_client/src/main.rs index e8c43ce..33df709 100644 --- a/daedalus_client/src/main.rs +++ b/daedalus_client/src/main.rs @@ -36,7 +36,12 @@ async fn main() -> Result<()> { return Ok(()); } - let semaphore = Arc::new(Semaphore::new(1)); + let semaphore = Arc::new(Semaphore::new( + dotenvy::var("CONCURRENCY_LIMIT") + .ok() + .and_then(|x| x.parse().ok()) + .unwrap_or(10), + )); // path, upload file let upload_files: DashMap = DashMap::new();