From 0bda2bcdff89626e1d39440e045dcc358edc6a3c Mon Sep 17 00:00:00 2001 From: Taimoor Zaeem Date: Wed, 8 Jul 2026 14:42:38 +0500 Subject: [PATCH] refactor: remove redundant destroyPool function Signed-off-by: Taimoor Zaeem --- src/PostgREST/AppState.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/PostgREST/AppState.hs b/src/PostgREST/AppState.hs index f7bcab30e..519530ef0 100644 --- a/src/PostgREST/AppState.hs +++ b/src/PostgREST/AppState.hs @@ -140,8 +140,10 @@ initWithPool pool conf loggerState metricsState observer appKiller = mdo return appState +-- | Destroy the pool on shutdown. +-- | Differs from flushPool in not emiting PoolFlushed observation. destroy :: AppState -> IO () -destroy = destroyPool +destroy AppState{..} = SQL.release statePool initPool :: AppConfig -> ObservationHandler -> IO SQL.Pool initPool cfg@AppConfig{..} observer = do @@ -226,11 +228,6 @@ flushPool AppState{..} = do SQL.release statePool stateObserver PoolFlushed --- | Destroy the pool on shutdown. --- | Differs from flushPool in not emiting PoolFlushed observation. -destroyPool :: AppState -> IO () -destroyPool AppState{..} = SQL.release statePool - getPgVersion :: AppState -> IO PgVersion getPgVersion = readIORef . statePgVersion