From fdaeea8fd286997096a00e42fe8e89a2020ae300 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 9 Jan 2024 19:29:00 -0500 Subject: [PATCH] fix: misleading "Starting.." logs on scache reload --- CHANGELOG.md | 4 ++++ src/PostgREST/App.hs | 2 ++ src/PostgREST/AppState.hs | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c3aaa888..b54256e55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). - #2887, Add Preference `max-affected` to limit affected resources - @taimoorzaeem +### Fixed + + - #3149, Misleading "Starting PostgREST.." logs on schema cache reloading - @steve-chavez + ### Deprecated - `Prefer: params=single-object` is deprecated. Use [a function with a single unnamed JSON parameter](https://postgrest.org/en/latest/references/api/stored_procedures.html#s-proc-single-json) instead. - @steve-chavez diff --git a/src/PostgREST/App.hs b/src/PostgREST/App.hs index 233cbf790..3c3b18770 100644 --- a/src/PostgREST/App.hs +++ b/src/PostgREST/App.hs @@ -68,6 +68,8 @@ type Handler = ExceptT Error run :: AppState -> IO () run appState = do + AppState.logWithZTime appState $ "Starting PostgREST " <> T.decodeUtf8 prettyVersion <> "..." + conf@AppConfig{..} <- AppState.getConfig appState AppState.connectionWorker appState -- Loads the initial SchemaCache Unix.installSignalHandlers (AppState.getMainThreadId appState) (AppState.connectionWorker appState) (AppState.reReadConfig False appState) diff --git a/src/PostgREST/AppState.hs b/src/PostgREST/AppState.hs index 7a8dd0526..71903d839 100644 --- a/src/PostgREST/AppState.hs +++ b/src/PostgREST/AppState.hs @@ -353,7 +353,6 @@ internalConnectionWorker appState = work where work = do config@AppConfig{..} <- getConfig appState - logWithZTime appState $ "Starting PostgREST " <> T.decodeUtf8 prettyVersion <> "..." logWithZTime appState "Attempting to connect to the database..." connected <- establishConnection appState config case connected of