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