From b0266202cfe72479774689db8879c3200190ea5f Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Thu, 17 Oct 2024 12:39:04 -0500 Subject: [PATCH] fix deadlock on client cache Signed-off-by: eternal-flame-AD --- src/client.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 5e03f00..1d678aa 100644 --- a/src/client.rs +++ b/src/client.rs @@ -34,7 +34,11 @@ impl ClientCache { ) }); - f(client.1.clone()).await + // inner is ref-counted + let client_cloned = client.1.clone(); + drop(client); + + f(client_cloned).await } pub fn gc(&self, dur: std::time::Duration) {