From 50f8218a5d877fd0309cf6432ad5e6d204dc9a68 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Wed, 5 Jun 2024 18:26:36 +0200 Subject: [PATCH] Asynchronously drop permits --- meilisearch/src/search_queue.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meilisearch/src/search_queue.rs b/meilisearch/src/search_queue.rs index 6d5044d20..152b900be 100644 --- a/meilisearch/src/search_queue.rs +++ b/meilisearch/src/search_queue.rs @@ -40,8 +40,9 @@ pub struct Permit { impl Drop for Permit { fn drop(&mut self) { + let sender = self.sender.clone(); // if the channel is closed then the whole instance is down - let _ = futures::executor::block_on(self.sender.send(())); + std::mem::drop(tokio::spawn(async move { sender.send(()).await })); } }