Skip to content

Commit

Permalink
address linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
robx committed Aug 4, 2022
1 parent f5766ca commit 8ae478e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/PostgREST/AppState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,12 @@ flushPool appState@AppState{..} = do
case old of
Nothing -> (Nothing, old)
_ -> (Just newPool, old)
case oldPool of
Nothing -> return ()
Just old -> SQL.release old
mapM_ SQL.release oldPool

-- | Destroy the pool on shutdown.
destroyPool :: AppState -> IO ()
destroyPool AppState{..} = do
pool <- readIORef statePool
case pool of
Nothing -> return ()
Just p -> SQL.release p
destroyPool AppState{..} =
readIORef statePool >>= mapM_ SQL.release

getPgVersion :: AppState -> IO PgVersion
getPgVersion = readIORef . statePgVersion
Expand Down

0 comments on commit 8ae478e

Please sign in to comment.