From 1e1cca5108b1334dd739cbe0184e06c29cffa486 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 13 Aug 2024 13:55:53 +0200 Subject: [PATCH] aqs: Only set already_acked_or_nacked after delete succeeded --- omniqueue/src/backends/azure_queue_storage.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/omniqueue/src/backends/azure_queue_storage.rs b/omniqueue/src/backends/azure_queue_storage.rs index e54cc7b..fd9a5b5 100644 --- a/omniqueue/src/backends/azure_queue_storage.rs +++ b/omniqueue/src/backends/azure_queue_storage.rs @@ -156,13 +156,14 @@ impl Acker for AqsAcker { if self.already_acked_or_nacked { return Err(QueueError::CannotAckOrNackTwice); } - self.already_acked_or_nacked = true; + self.client .pop_receipt_client(self.pop_receipt.clone()) .delete() .await - .map_err(QueueError::generic) - .map(|_| ()) + .map_err(QueueError::generic)?; + self.already_acked_or_nacked = true; + Ok(()) } async fn nack(&mut self) -> Result<()> {