From 6238075a1de69c1c8e194a72bac4033409abad4c Mon Sep 17 00:00:00 2001 From: Paolo Capriotti Date: Tue, 10 Dec 2024 11:36:46 +0100 Subject: [PATCH] Linter --- services/cannon/src/Cannon/RabbitMq.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/cannon/src/Cannon/RabbitMq.hs b/services/cannon/src/Cannon/RabbitMq.hs index fedc54a060c..ead19aad5fb 100644 --- a/services/cannon/src/Cannon/RabbitMq.hs +++ b/services/cannon/src/Cannon/RabbitMq.hs @@ -165,6 +165,9 @@ createConnection pool = mask_ $ do void . async $ do v <- race (takeMVar closedVar) (readMVar pool.deadVar) when (isRight v) $ + -- close connection and ignore exceptions + -- close connection and ignore exceptions + -- close connection and ignore exceptions catch @SomeException (Q.closeConnection conn) $ \_ -> pure () @@ -182,7 +185,7 @@ openConnection pool = do -- assigned to this connection, since there are potential races with other -- connections being opened at the same time. However, this is only used to -- name the connection, and we only rely on names for tests, so it is fine. - connId <- atomically $ readTVar pool.nextId + connId <- readTVarIO pool.nextId (username, password) <- readCredsFromEnv recovering rabbitMqRetryPolicy