We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9dc852d commit bce28bdCopy full SHA for bce28bd
src/PostgREST/AppState.hs
@@ -136,17 +136,12 @@ flushPool appState@AppState{..} = do
136
case old of
137
Nothing -> (Nothing, old)
138
_ -> (Just newPool, old)
139
- case oldPool of
140
- Nothing -> return ()
141
- Just old -> SQL.release old
+ mapM_ SQL.release oldPool
142
143
-- | Destroy the pool on shutdown.
144
destroyPool :: AppState -> IO ()
145
-destroyPool AppState{..} = do
146
- pool <- readIORef statePool
147
- case pool of
148
149
- Just p -> SQL.release p
+destroyPool AppState{..} =
+ readIORef statePool >>= mapM_ SQL.release
150
151
getPgVersion :: AppState -> IO PgVersion
152
getPgVersion = readIORef . statePgVersion
0 commit comments