Skip to content

Commit

Permalink
comment that in-use connections aren't affected
Browse files Browse the repository at this point in the history
  • Loading branch information
robx committed Aug 24, 2022
1 parent b589495 commit 67cbe5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/PostgREST/AppState.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ usePool appState@AppState{..} session = do
_ -> return res

-- | Flush the connection pool so that any future use of the pool will
-- use connections freshly established after this call.
-- use connections freshly established after this call. In-use
-- connections aren't affected, they just won't be reused anymore.
--
-- Does nothing if the pool has been destroyed.
flushPool :: AppState -> IO ()
Expand All @@ -139,6 +140,7 @@ flushPool appState@AppState{..} = do
mapM_ SQL.release oldPool

-- | Destroy the pool on shutdown.
-- This doesn't interrupt in-use connections.
destroyPool :: AppState -> IO ()
destroyPool AppState{..} =
readIORef statePool >>= mapM_ SQL.release
Expand Down

0 comments on commit 67cbe5b

Please sign in to comment.