You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PostgresWebsockets/Config.hs
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,7 @@ data AppConfig = AppConfig {
34
34
, configJwtSecret::ByteString
35
35
, configJwtSecretIsBase64::Bool
36
36
, configPool::Int
37
+
, configRetries::Int
37
38
}
38
39
39
40
--| User friendly version number
@@ -70,6 +71,7 @@ readOptions =
70
71
<*> var str "PGWS_JWT_SECRET" (help "Secret used to sign JWT tokens used to open communications channels")
71
72
<*> var auto "PGWS_JWT_SECRET_BASE64" (def False<> helpDef show<> help "Indicate whether the JWT secret should be decoded from a base64 encoded string")
72
73
<*> var auto "PGWS_POOL_SIZE" (def 10<> helpDef show<> help "How many connection to the database should be used by the connection pool")
74
+
<*> var auto "PGWS_RETRIES" (def 5<> helpDef show<> help "How many times it should try to connect to the database on startup before exiting with an error")
putErrLn $"Error connecting notification listener to database: "<>show err
60
-
returnTrue
60
+
pure$ rsIterNumber < maxRetries -1
61
61
_ ->returnFalse
62
62
63
63
{- | Returns a multiplexer from a channel and an IO Connection, listen for different database notifications on the provided channel using the connection produced.
0 commit comments