From ac9cade3e4300df12fb067bc72d285d2d5a79516 Mon Sep 17 00:00:00 2001 From: asonix Date: Mon, 4 Dec 2023 15:43:55 -0600 Subject: [PATCH] Bail on closed semaphore (semaphore shouldn't close anyway) --- src/generate.rs | 2 +- src/ingest.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generate.rs b/src/generate.rs index 132a7d3..b0d3373 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -59,7 +59,7 @@ async fn process( timeout: u64, hash: R::Bytes, ) -> Result<(Details, Bytes), Error> { - let permit = crate::PROCESS_SEMAPHORE.acquire().await; + let permit = crate::PROCESS_SEMAPHORE.acquire().await?; let identifier = if let Some(identifier) = repo .still_identifier_from_alias::(&alias) diff --git a/src/ingest.rs b/src/ingest.rs index e8f29d5..21a6c3c 100644 --- a/src/ingest.rs +++ b/src/ingest.rs @@ -67,7 +67,7 @@ where .await .map_err(|_| UploadError::AggregateTimeout)??; - let permit = crate::PROCESS_SEMAPHORE.acquire().await; + let permit = crate::PROCESS_SEMAPHORE.acquire().await?; tracing::trace!("Validating bytes"); let (input_type, validated_reader) =