Skip to content

Commit bce28bd

Browse files
committed
address linter complaints
1 parent 9dc852d commit bce28bd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Diff for: src/PostgREST/AppState.hs

+3-8
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,12 @@ flushPool appState@AppState{..} = do
136136
case old of
137137
Nothing -> (Nothing, old)
138138
_ -> (Just newPool, old)
139-
case oldPool of
140-
Nothing -> return ()
141-
Just old -> SQL.release old
139+
mapM_ SQL.release oldPool
142140

143141
-- | Destroy the pool on shutdown.
144142
destroyPool :: AppState -> IO ()
145-
destroyPool AppState{..} = do
146-
pool <- readIORef statePool
147-
case pool of
148-
Nothing -> return ()
149-
Just p -> SQL.release p
143+
destroyPool AppState{..} =
144+
readIORef statePool >>= mapM_ SQL.release
150145

151146
getPgVersion :: AppState -> IO PgVersion
152147
getPgVersion = readIORef . statePgVersion

0 commit comments

Comments
 (0)