fix: listener retries with exponential backoff

Also corrects the admin ready response which now considers the listener
state.
This commit is contained in:
steve-chavez
2024-05-19 20:48:59 -05:00
committed by Steve Chavez
parent bfa4e1bedb
commit 3cf565614d
6 changed files with 92 additions and 68 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ data Observation
| ConnectionPgVersionErrorObs SQL.UsageError
| DBListenStart Text
| DBListenFail Text (Either SQL.ConnectionError (Either SomeException ()))
| DBListenRetry
| DBListenRetry Int
| DBListenerGotSCacheMsg ByteString
| DBListenerGotConfigMsg ByteString
| ConfigReadErrorObs SQL.UsageError
@@ -105,8 +105,8 @@ observationMessage = \case
Left err -> show err
Right err -> showListenerError err
)
DBListenRetry ->
"Retrying listening for notifications..."
DBListenRetry delay ->
"Retrying listening for notifications in " <> (show delay::Text) <> " seconds..."
DBListenerGotSCacheMsg channel ->
"Received a schema cache reload message on the " <> show channel <> " channel"
DBListenerGotConfigMsg channel ->