Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Feb 29, 2024
1 parent 493fae7 commit 8a9389f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/library/exposed/Hasql/Pool.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,14 @@ use Pool {..} sess = do
now <- getMonotonicTimeNSec
id <- Uuid.nextRandom
poolObserver (ConnectionObservation id ConnectingConnectionStatus)
connRes <- Connection.acquire settings
case connRes of
Connection.acquire settings >>= \case
Left connErr -> do
poolObserver (ConnectionObservation id (TerminatedConnectionStatus (NetworkErrorConnectionTerminationReason (fmap (Text.decodeUtf8With Text.lenientDecode) connErr))))
atomically $ modifyTVar' poolCapacity succ
return $ Left $ ConnectionUsageError connErr
Right entry -> do
Right connection -> do
poolObserver (ConnectionObservation id ReadyForUseConnectionStatus)
onLiveConn reuseVar (Entry entry now now id)
onLiveConn reuseVar (Entry connection now now id)

onConn reuseVar entry = do
now <- getMonotonicTimeNSec
Expand Down

0 comments on commit 8a9389f

Please sign in to comment.